From 170fe3d9d106c5b041552cc7db06d7dc310c375d Mon Sep 17 00:00:00 2001 From: the_undefined Date: Tue, 13 May 2008 03:40:24 +0000 Subject: [PATCH] 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 --- cake/libs/router.php | 2 +- cake/tests/cases/libs/router.test.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 77443b3cb..35c9ad9ba 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -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; } diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 03e570ae7..96dc183e9 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -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() {