mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Don't throw redirection warning if redirection to the same place.
This commit is contained in:
parent
b43bf68f9c
commit
b6fd27663a
@ -454,7 +454,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
|||||||
public function redirect($url, $code=302) {
|
public function redirect($url, $code=302) {
|
||||||
if(!$this->response) $this->response = new SS_HTTPResponse();
|
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')
|
user_error("Already directed to " . $this->response->getHeader('Location')
|
||||||
. "; now trying to direct to $url", E_USER_WARNING);
|
. "; now trying to direct to $url", E_USER_WARNING);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user