diff --git a/core/startup/ConfirmationTokenChain.php b/core/startup/ConfirmationTokenChain.php index 9938285c0..660b64c46 100644 --- a/core/startup/ConfirmationTokenChain.php +++ b/core/startup/ConfirmationTokenChain.php @@ -123,9 +123,10 @@ class ConfirmationTokenChain * @return array */ public function getRedirectUrlParams() { - $params = array(); + $params = $_GET; + unset($params['url']); foreach ($this->filteredTokens() as $token) { - $params = array_merge($params, $token->getRedirectUrlParams()); + $params = array_merge($params, $token->params()); } return $params; diff --git a/tests/core/startup/ConfirmationTokenChainTest.php b/tests/core/startup/ConfirmationTokenChainTest.php index fad9ea2c4..d6a2fa2bc 100644 --- a/tests/core/startup/ConfirmationTokenChainTest.php +++ b/tests/core/startup/ConfirmationTokenChainTest.php @@ -123,19 +123,21 @@ class ConfirmationTokenChainTest extends SapphireTest { } public function testGetRedirectUrlParams() { - $mockToken = $this->getTokenRequiringReload(true, array('getRedirectUrlParams')); + $mockToken = $this->getTokenRequiringReload(true, array('params')); $mockToken->expects($this->once()) - ->method('getRedirectUrlParams') + ->method('params') ->will($this->returnValue(array('mockTokenParam' => '1'))); - $secondMockToken = $this->getTokenRequiringReload(true, array('getRedirectUrlParams')); + $secondMockToken = $this->getTokenRequiringReload(true, array('params')); $secondMockToken->expects($this->once()) - ->method('getRedirectUrlParams') + ->method('params') ->will($this->returnValue(array('secondMockTokenParam' => '2'))); $chain = new ConfirmationTokenChain(); $chain->pushToken($mockToken); $chain->pushToken($secondMockToken); - $this->assertEquals(array('mockTokenParam' => '1', 'secondMockTokenParam' => '2'), $chain->getRedirectUrlParams()); + $params = $chain->getRedirectUrlParams(); + $this->assertEquals('1', $params['mockTokenParam']); + $this->assertEquals('2', $params['secondMockTokenParam']); } }