Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 8133f72b53c3391025ef62538e9b6627d9dda70a 1 parent 52be365
@markstory markstory authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Cake/Controller/Component/AuthComponent.php
View
6 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);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.