[HttpKernel] UriSigner::buildUrl - default params for http_build_query
This commit is contained in:
parent
9b1eee161d
commit
3d6933f00c
@ -36,4 +36,16 @@ class UriSignerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertTrue($signer->sign('http://example.com/foo?foo=bar&bar=foo') === $signer->sign('http://example.com/foo?bar=foo&foo=bar'));
|
||||
}
|
||||
|
||||
public function testCheckWithDifferentArgSeparator()
|
||||
{
|
||||
$this->iniSet('arg_separator.output', '&');
|
||||
$signer = new UriSigner('foobar');
|
||||
|
||||
$this->assertSame(
|
||||
"http://example.com/foo?baz=bay&foo=bar&_hash=rIOcC%2FF3DoEGo%2FvnESjSp7uU9zA9S%2F%2BOLhxgMexoPUM%3D",
|
||||
$signer->sign('http://example.com/foo?foo=bar&baz=bay')
|
||||
);
|
||||
$this->assertTrue($signer->check($signer->sign('http://example.com/foo?foo=bar&baz=bay')));
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class UriSigner
|
||||
private function buildUrl(array $url, array $params = array())
|
||||
{
|
||||
ksort($params);
|
||||
$url['query'] = http_build_query($params);
|
||||
$url['query'] = http_build_query($params, '', '&');
|
||||
|
||||
$scheme = isset($url['scheme']) ? $url['scheme'].'://' : '';
|
||||
$host = isset($url['host']) ? $url['host'] : '';
|
||||
|
Reference in New Issue
Block a user