Skip to content

Commit

Permalink
Fix url option key.
Browse files Browse the repository at this point in the history
Closes #3845
  • Loading branch information
ADmad committed Jul 1, 2014
1 parent 06bdf75 commit c1e7d43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controller/Component/AuthComponent.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ public function redirectUrl($url = null) {
$redir = '/'; $redir = '/';
} }
if (is_array($redir)) { if (is_array($redir)) {
return Router::url($redir + array('base' => false)); return Router::url($redir + array('_base' => false));
} }
return $redir; return $redir;
} }
Expand Down
7 changes: 7 additions & 0 deletions tests/TestCase/Controller/Component/AuthComponentTest.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1143,6 +1143,13 @@ public function testRedirectSet() {
$result = $this->Auth->redirectUrl($value); $result = $this->Auth->redirectUrl($value);
$this->assertEquals('/users/home', $result); $this->assertEquals('/users/home', $result);
$this->assertEquals($value, $this->Auth->session->read('Auth.redirect')); $this->assertEquals($value, $this->Auth->session->read('Auth.redirect'));

$request = new Request();
$request->base = '/base';
Router::setRequestInfo($request);

$result = $this->Auth->redirectUrl($value);
$this->assertEquals('/users/home', $result);
} }


/** /**
Expand Down

0 comments on commit c1e7d43

Please sign in to comment.