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:
the_undefined 2008-05-13 03:40:24 +00:00
parent 451192018a
commit 170fe3d9d1
2 changed files with 8 additions and 1 deletions

View file

@ -1074,7 +1074,7 @@ class Router extends Object {
$out = $q;
$q = $extra;
}
$out .= http_build_query($q);
$out .= http_build_query($q, null, '&');
if (strpos($out, '?') !== 0) {
$out = '?' . $out;
}

View file

@ -896,6 +896,13 @@ class RouterTest extends UnitTestCase {
$expected .= '&more=test+data';
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => array('var' => 'test', 'var2' => 'test2', 'more' => 'test data')));
$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() {