diff --git a/cake/libs/route/cake_route.php b/cake/libs/route/cake_route.php index 9d1fb97c7..27e453ea9 100644 --- a/cake/libs/route/cake_route.php +++ b/cake/libs/route/cake_route.php @@ -269,6 +269,11 @@ class CakeRoute { return false; } + // Missing defaults is a fail. + if (array_diff_key($defaults, $url) !== array()) { + return false; + } + $named = $pass = $diff = array(); foreach ($url as $key => $value) { @@ -307,7 +312,6 @@ class CakeRoute { } } - //if a not a greedy route, no extra params are allowed. if (!$this->_greedy && ( (!empty($pass) || !empty($named)) || array_diff_key($diff, $keyNames) != array()) ) { return false; diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 31539a185..6d2f700f6 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1516,7 +1516,7 @@ class RouterTest extends CakeTestCase { $result = Router::url(array('controller' => 'images', 'action' => 'add')); $expected = '/images/add'; - $this->assertEqual($result, $expected); + $this->assertEquals($expected, $result); $result = Router::url(array('controller' => 'images', 'action' => 'add', 'protected' => true)); $expected = '/protected/images/add';