mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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
This commit is contained in:
parent
8bb11e49d7
commit
b68c78fc0f
2 changed files with 6 additions and 1 deletions
|
@ -337,6 +337,11 @@ class AuthComponent extends Object {
|
||||||
if (!$this->user()) {
|
if (!$this->user()) {
|
||||||
if (!$this->RequestHandler->isAjax()) {
|
if (!$this->RequestHandler->isAjax()) {
|
||||||
$this->Session->setFlash($this->authError, 'default', array(), 'auth');
|
$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);
|
$this->Session->write('Auth.redirect', $url);
|
||||||
$controller->redirect($loginAction);
|
$controller->redirect($loginAction);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -841,7 +841,7 @@ class AuthTest extends CakeTestCase {
|
||||||
// QueryString parameters
|
// QueryString parameters
|
||||||
$_back = $_GET;
|
$_back = $_GET;
|
||||||
$_GET = array(
|
$_GET = array(
|
||||||
'url' => '/posts/index/29?print=true&refer=menu',
|
'url' => '/posts/index/29',
|
||||||
'print' => 'true',
|
'print' => 'true',
|
||||||
'refer' => 'menu'
|
'refer' => 'menu'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue