8000 [HttpKernel] Forcing string comparison on query parameters sort in UriSigner by Timvd · Pull Request #17287 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Forcing string comparison on query parameters sort in UriSigner #17287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added sort order SORT_STRING for params in UriSigner
  • Loading branch information
Tim van Densen committed Jan 7, 2016
commit b94da8ca4dff1c2c4c673382b74d3b82dfe388c0
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
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/UriSigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private function computeHash($uri)

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

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