MINOR: Don't throw redirection warning if redirection to the same place.

This commit is contained in:
Sam Minnee 2011-08-18 23:32:40 +12:00 committed by Ingo Schommer
parent b43bf68f9c
commit b6fd27663a

View File

@ -454,7 +454,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
public function redirect($url, $code=302) {
if(!$this->response) $this->response = new SS_HTTPResponse();
if($this->response->getHeader('Location')) {
if($this->response->getHeader('Location') && $this->response->getHeader('Location') != $url) {
user_error("Already directed to " . $this->response->getHeader('Location')
. "; now trying to direct to $url", E_USER_WARNING);
return;