Permalink
Browse files

Adding break; to escape out of prefix checking, optimizes operations …

…with many prefixes.
  • Loading branch information...
1 parent f027641 commit d2b4e33e1b71bc1ebb13b342a4e443aeb680d500 @markstory markstory committed Sep 30, 2009
Showing with 3 additions and 0 deletions.
  1. +3 −0 cake/libs/router.php
@@ -913,6 +913,7 @@ function url($url = null, $full = false) {
foreach ($_this->__prefixes as $prefix) {
if (!empty($url[$prefix])) {
$url['action'] = str_replace($prefix . '_', '', $url['action']);
+ break;
}
}
@@ -929,6 +930,7 @@ function url($url = null, $full = false) {
foreach ($_this->__prefixes as $prefix) {
if (isset($url[$prefix])) {
array_unshift($urlOut, $prefix);
+ break;
}
}
$output = join('/', $urlOut) . '/';
@@ -964,6 +966,7 @@ function url($url = null, $full = false) {
foreach ($_this->__prefixes as $prefix) {
if (isset($params[$prefix])) {
$output .= $prefix . '/';
+ break;
}
}
if (!empty($params['plugin']) && $params['plugin'] !== $params['controller']) {

0 comments on commit d2b4e33

Please sign in to comment.