mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Router::reverse now removes models and paging keys that controllers can insert into params arrays.
This commit is contained in:
parent
5b78a662e8
commit
df8914b2e4
2 changed files with 4 additions and 2 deletions
|
@ -994,7 +994,7 @@ class Router {
|
|||
$pass = $params['pass'];
|
||||
$named = $params['named'];
|
||||
$url = $params['url'];
|
||||
unset($params['pass'], $params['named'], $params['url'], $url['url']);
|
||||
unset($params['pass'], $params['named'], $params['paging'], $params['models'], $params['url'], $url['url']);
|
||||
$params = array_merge($params, $pass, $named);
|
||||
if (!empty($url)) {
|
||||
$params['?'] = $url;
|
||||
|
|
|
@ -1987,7 +1987,9 @@ class RouterTest extends CakeTestCase {
|
|||
'action' => 'view',
|
||||
'pass' => array(1),
|
||||
'named' => array(),
|
||||
'url' => array('url' => 'eng/posts/view/1', 'foo' => 'bar', 'baz' => 'quu')
|
||||
'url' => array('url' => 'eng/posts/view/1', 'foo' => 'bar', 'baz' => 'quu'),
|
||||
'paging' => array(),
|
||||
'models' => array()
|
||||
);
|
||||
$result = Router::reverse($params);
|
||||
$this->assertEqual($result, '/eng/posts/view/1?foo=bar&baz=quu');
|
||||
|
|
Loading…
Reference in a new issue