Added sort order SORT_STRING for params in UriSigner
This commit is contained in:
parent
f9bf3f8d5a
commit
2040139db6
@ -33,6 +33,7 @@ class UriSignerTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertTrue($signer->check($signer->sign('http://example.com/foo')));
|
$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')));
|
||||||
|
$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'));
|
$this->assertTrue($signer->sign('http://example.com/foo?foo=bar&bar=foo') === $signer->sign('http://example.com/foo?bar=foo&foo=bar'));
|
||||||
}
|
}
|
||||||
|
@ -91,8 +91,8 @@ class UriSigner
|
|||||||
|
|
||||||
private function buildUrl(array $url, array $params = array())
|
private function buildUrl(array $url, array $params = array())
|
||||||
{
|
{
|
||||||
ksort($params);
|
ksort($params, SORT_STRING);
|
||||||
$url['query'] = http_build_query($params);
|
$url['query'] = http_build_query($params, '', '&');
|
||||||
|
|
||||||
$scheme = isset($url['scheme']) ? $url['scheme'].'://' : '';
|
$scheme = isset($url['scheme']) ? $url['scheme'].'://' : '';
|
||||||
$host = isset($url['host']) ? $url['host'] : '';
|
$host = isset($url['host']) ? $url['host'] : '';
|
||||||
|
Reference in New Issue
Block a user