mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-10 05:22:41 +00:00
fixes #3415, notices in router
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6988 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
e8bd74946c
commit
f65f2fd3bc
2 changed files with 11 additions and 8 deletions
|
@ -1127,7 +1127,7 @@ class Router extends Object {
|
|||
$q = $extra;
|
||||
}
|
||||
$out .= http_build_query($q, null, '&');
|
||||
if ($out[0] != '?') {
|
||||
if (isset($out[0]) && $out[0] != '?') {
|
||||
$out = '?' . $out;
|
||||
}
|
||||
return $out;
|
||||
|
|
|
@ -257,6 +257,9 @@ class RouterTest extends UnitTestCase {
|
|||
$result = Router::url(array('controller' => 'posts', '0', '?' => array('var' => 'test', 'var2' => 'test2')));
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = Router::url(array('controller' => 'posts', '0', '?' => array('var' => null)));
|
||||
$this->assertEqual($result, '/posts/index/0');
|
||||
|
||||
$result = Router::url(array('controller' => 'posts', '0', '?' => 'var=test&var2=test2', '#' => 'unencoded string %'));
|
||||
$expected = '/posts/index/0?var=test&var2=test2#unencoded+string+%25';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue