mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
parent
4b3a8ea348
commit
31033239bd
2 changed files with 4 additions and 4 deletions
|
@ -497,9 +497,9 @@ class CakeRoute {
|
|||
$named = array();
|
||||
foreach ($params['named'] as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$flat = Hash::flatten($value, '][');
|
||||
$flat = Hash::flatten($value, '%5D%5B');
|
||||
foreach ($flat as $namedKey => $namedValue) {
|
||||
$named[] = $key . "[$namedKey]" . $separator . rawurlencode($namedValue);
|
||||
$named[] = $key . "%5B{$namedKey}%5D" . $separator . rawurlencode($namedValue);
|
||||
}
|
||||
} else {
|
||||
$named[] = $key . $separator . rawurlencode($value);
|
||||
|
|
|
@ -798,7 +798,7 @@ class CakeRouteTest extends CakeTestCase {
|
|||
)
|
||||
);
|
||||
$result = $route->match($url);
|
||||
$expected = '/posts/index/filter[0]:one/filter[model]:value';
|
||||
$expected = '/posts/index/filter%5B0%5D:one/filter%5Bmodel%5D:value';
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$url = array(
|
||||
|
@ -813,7 +813,7 @@ class CakeRouteTest extends CakeTestCase {
|
|||
)
|
||||
);
|
||||
$result = $route->match($url);
|
||||
$expected = '/posts/index/filter[0]:one/filter[model][0]:two/filter[model][order]:field';
|
||||
$expected = '/posts/index/filter%5B0%5D:one/filter%5Bmodel%5D%5B0%5D:two/filter%5Bmodel%5D%5Border%5D:field';
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue