Skip to content

Commit

Permalink
Added sort order SORT_STRING for params in UriSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim van Densen authored and fabpot committed Jan 7, 2016
1 parent f9bf3f8 commit 2040139
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpKernel/Tests/UriSignerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function testCheck()

$this->assertTrue($signer->check($signer->sign('http://example.com/foo')));
$this->assertTrue($signer->check($signer->sign('http://example.com/foo?foo=bar')));
$this->assertTrue($signer->check($signer->sign('http://example.com/foo?foo=bar&0=integer')));

$this->assertTrue($signer->sign('http://example.com/foo?foo=bar&bar=foo') === $signer->sign('http://example.com/foo?bar=foo&foo=bar'));
}
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpKernel/UriSigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ private function computeHash($uri)

private function buildUrl(array $url, array $params = array())
{
ksort($params);
$url['query'] = http_build_query($params);
ksort($params, SORT_STRING);
$url['query'] = http_build_query($params, '', '&');

$scheme = isset($url['scheme']) ? $url['scheme'].'://' : '';
$host = isset($url['host']) ? $url['host'] : '';
Expand Down

0 comments on commit 2040139

Please sign in to comment.