Browse Source

Make permission denied redirects host relative.

This helps fix infinite redirect loops when HTTP_X_FORWARDED_HOST is
set, and fixes redirects back to external domains on authentication
errors.

Fixes #3207
mark_story 13 years ago
parent
commit
0282194c20
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Controller/Component/AuthComponent.php

+ 1 - 1
lib/Cake/Controller/Component/AuthComponent.php

@@ -332,7 +332,7 @@ class AuthComponent extends Component {
 		if (!empty($this->loginRedirect)) {
 			$default = $this->loginRedirect;
 		}
-		$controller->redirect($controller->referer($default), null, true);
+		$controller->redirect($controller->referer($default, true), null, true);
 		return false;
 	}