Permalink
Browse files

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

  • Loading branch information...
1 parent b43bf68 commit b6fd27663aa38524ad127fb6756741689e324503 @sminnee sminnee committed with chillu Aug 18, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 control/Controller.php
View
@@ -454,7 +454,7 @@ public function popCurrent() {
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;

0 comments on commit b6fd276

Please sign in to comment.