mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
52be365598
commit
8133f72b53
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue