10000 Added sort order SORT_STRING for params in UriSigner · symfony/symfony@2040139 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2040139

Browse files
Tim van Densenfabpot
Tim van Densen
authored andcommitted
Added sort order SORT_STRING for params in UriSigner
1 parent f9bf3f8 commit 2040139

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Component/HttpKernel/Tests/UriSignerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function testCheck()
3333

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

3738
$this->assertTrue($signer->sign('http://example.com/foo?foo=bar&bar=foo') === $signer->sign('http://example.com/foo?bar=foo&foo=bar'));
3839
}

src/Symfony/Component/HttpKernel/UriSigner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ private function computeHash($uri)
9191

9292
private function buildUrl(array $url, array $params = array())
9393
{
94-
ksort($params);
95-
$url['query'] = http_build_query($params);
94+
ksort($params, SORT_STRING);
95+
$url['query'] = http_build_query($params, '', '&');
9696

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

0 commit comments

Comments
 (0)
0