Permalink
Browse files

Update AuthComponent to not strip when normalizing URLs.

Revert most of the changes done to fix #3897 originally and try
a different strategy of solving the base path issues and not breaking
apps running in a subdirectory.

Fixes #3916
  • Loading branch information...
markstory committed Jul 13, 2013
1 parent 52be365 commit 8133f72b53c3391025ef62538e9b6627d9dda70a
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Cake/Controller/Component/AuthComponent.php
@@ -311,7 +311,8 @@ public function startup(Controller $controller) {
if ($loginAction == $url) {
if (empty($request->data)) {
if (!$this->Session->check('Auth.redirect') && env('HTTP_REFERER')) {
- $this->Session->write('Auth.redirect', $controller->referer(null, true));
+ $referer = $request->referer(true);
+ $this->Session->write('Auth.redirect', $referer);
}
}
return true;
@@ -666,7 +667,6 @@ public function redirectUrl($url = null) {
$this->Session->write('Auth.redirect', $redir);
} elseif ($this->Session->check('Auth.redirect')) {
$redir = $this->Session->read('Auth.redirect');
- $redir = is_string($redir) ? ltrim($redir, '/') : $redir;
$this->Session->delete('Auth.redirect');
if (Router::normalize($redir) == Router::normalize($this->loginAction)) {
@@ -677,7 +677,7 @@ public function redirectUrl($url = null) {
} else {
$redir = '/';
}
- return Router::normalize($redir);
+ return Router::normalize($redir, false);
}
/**

0 comments on commit 8133f72

Please sign in to comment.