Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing lost querystring params when user request without a session is…

… performed. Test case updated. Fixes #6211

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8156 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit b68c78fc0f86f669027dc90cdc09dbde999ba4e3 1 parent 8bb11e4
@markstory markstory authored
View
5 cake/libs/controller/components/auth.php
@@ -337,6 +337,11 @@ function startup(&$controller) {
if (!$this->user()) {
if (!$this->RequestHandler->isAjax()) {
$this->Session->setFlash($this->authError, 'default', array(), 'auth');
+ if (!empty($controller->params['url']) && count($controller->params['url']) >= 2) {
+ $query = $controller->params['url'];
+ unset($query['url']);
+ $url .= Router::queryString($query, array());
+ }
$this->Session->write('Auth.redirect', $url);
$controller->redirect($loginAction);
return false;
View
2  cake/tests/cases/libs/controller/components/auth.test.php
@@ -841,7 +841,7 @@ function testLoginRedirect() {
// QueryString parameters
$_back = $_GET;
$_GET = array(
- 'url' => '/posts/index/29?print=true&refer=menu',
+ 'url' => '/posts/index/29',
'print' => 'true',
'refer' => 'menu'
);
Please sign in to comment.
Something went wrong with that request. Please try again.