File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -36,4 +36,16 @@ public function testCheck()
3636
3737 $ this ->assertTrue ($ signer ->sign ('http://example.com/foo?foo=bar&bar=foo ' ) === $ signer ->sign ('http://example.com/foo?bar=foo&foo=bar ' ));
3838 }
39+
40+ public function testCheckWithDifferentArgSeparator ()
41+ {
42+ $ this ->iniSet ('arg_separator.output ' , '& ' );
43+ $ signer = new UriSigner ('foobar ' );
44+
45+ $ this ->assertSame (
46+ "http://example.com/foo?baz=bay&foo=bar&_hash=rIOcC%2FF3DoEGo%2FvnESjSp7uU9zA9S%2F%2BOLhxgMexoPUM%3D " ,
47+ $ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' )
48+ );
49+ $ this ->assertTrue ($ signer ->check ($ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' )));
50+ }
3951}
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ private function computeHash($uri)
9292 private function buildUrl (array $ url , array $ params = array ())
9393 {
9494 ksort ($ params );
95- $ url ['query ' ] = http_build_query ($ params );
95+ $ url ['query ' ] = http_build_query ($ params, '' , ' & ' );
9696
9797 $ scheme = isset ($ url ['scheme ' ]) ? $ url ['scheme ' ].':// ' : '' ;
9898 $ host = isset ($ url ['host ' ]) ? $ url ['host ' ] : '' ;
You can’t perform that action at this time.
0 commit comments