Skip to content

Commit

Permalink
Router::reverse now removes models and paging keys that controllers c…
Browse files Browse the repository at this point in the history
…an insert into params arrays.
  • Loading branch information
markstory committed Dec 28, 2009
1 parent 5b78a66 commit df8914b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cake/libs/router.php
Expand Up @@ -994,7 +994,7 @@ function reverse($params) {
$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;
Expand Down
4 changes: 3 additions & 1 deletion cake/tests/cases/libs/router.test.php
Expand Up @@ -1987,7 +1987,9 @@ function testRouterReverse() {
'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');
Expand Down

0 comments on commit df8914b

Please sign in to comment.