Skip to content

Commit

Permalink
Removing use of Set::filter() as its slowish.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 2, 2009
1 parent 67ccac1 commit 728613a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cake/libs/router.php
Expand Up @@ -1365,7 +1365,14 @@ function match($url) {
if (array_intersect_key($keyNames, $url) != $keyNames) {
return false;
}
$diff = Set::filter(Set::diff($url, $defaults), true);

$diffUnfiltered = Set::diff($url, $defaults);
$diff = array();
foreach ($diffUnfiltered as $key => $var) {
if ($var === 0 || $var === '0' || !empty($var)) {
$diff[$key] = $var;
}
}

//if a not a greedy route, no extra params are allowed.
if (!$this->_greedy && array_diff_key($diff, $keyNames) != array()) {
Expand Down

0 comments on commit 728613a

Please sign in to comment.