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
This commit is contained in:
mark_story 2013-07-12 21:17:25 -04:00
parent 52be365598
commit 8133f72b53

View file

@ -311,7 +311,8 @@ class AuthComponent extends Component {
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 @@ class AuthComponent extends Component {
$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 @@ class AuthComponent extends Component {
} else {
$redir = '/';
}
return Router::normalize($redir);
return Router::normalize($redir, false);
}
/**