Permalink
Browse files

Removing use of Set::filter() as its slowish.

  • Loading branch information...
1 parent 67ccac1 commit 728613a34d6a4d12f78823bd89f1ede75e2efde7 @markstory markstory committed Dec 2, 2009
Showing with 8 additions and 1 deletion.
  1. +8 −1 cake/libs/router.php
View
@@ -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()) {

0 comments on commit 728613a

Please sign in to comment.