From 43d359b1d7e083c9c7cb9afb5ad7995d2aea1641 Mon Sep 17 00:00:00 2001 From: euromark Date: Mon, 28 Apr 2014 17:23:26 +0200 Subject: [PATCH 1/2] Make referer() behave as expected. --- lib/Cake/Controller/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index 00b80fb2f..ca311fe86 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -970,7 +970,7 @@ class Controller extends Object implements CakeEventListener { $referer = $this->request->referer($local); if ($referer === '/' && $default) { - return Router::url($default, true); + return Router::url($default, !$local); } return $referer; } From 8679c5cd180419e272833c4d1fa2f41844fc89de Mon Sep 17 00:00:00 2001 From: euromark Date: Mon, 28 Apr 2014 17:33:56 +0200 Subject: [PATCH 2/2] Fix test --- lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index 122cadb18..bc544be18 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -938,7 +938,7 @@ class AuthComponentTest extends CakeTestCase { array($CakeRequest, $CakeResponse) ); - $expected = Router::url($this->Auth->loginRedirect, true); + $expected = Router::url($this->Auth->loginRedirect); $Controller->expects($this->once()) ->method('redirect') ->with($this->equalTo($expected));