mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 10:36:16 +00:00
Fixed Router::queryString php.ini setting dependency, closes #4614
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6831 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
451192018a
commit
170fe3d9d1
2 changed files with 8 additions and 1 deletions
|
@ -1074,7 +1074,7 @@ class Router extends Object {
|
||||||
$out = $q;
|
$out = $q;
|
||||||
$q = $extra;
|
$q = $extra;
|
||||||
}
|
}
|
||||||
$out .= http_build_query($q);
|
$out .= http_build_query($q, null, '&');
|
||||||
if (strpos($out, '?') !== 0) {
|
if (strpos($out, '?') !== 0) {
|
||||||
$out = '?' . $out;
|
$out = '?' . $out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -896,6 +896,13 @@ class RouterTest extends UnitTestCase {
|
||||||
$expected .= '&more=test+data';
|
$expected .= '&more=test+data';
|
||||||
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => array('var' => 'test', 'var2' => 'test2', 'more' => 'test data')));
|
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => array('var' => 'test', 'var2' => 'test2', 'more' => 'test data')));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
// Test bug #4614
|
||||||
|
$restore = ini_get('arg_separator.output');
|
||||||
|
ini_set('arg_separator.output', '&');
|
||||||
|
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => array('var' => 'test', 'var2' => 'test2', 'more' => 'test data')));
|
||||||
|
$this->assertEqual($result, $expected);
|
||||||
|
ini_set('arg_separator.output', $restore);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testNamedArgsUrlGeneration() {
|
function testNamedArgsUrlGeneration() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue