mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding break; to escape out of prefix checking, optimizes operations with many prefixes.
This commit is contained in:
parent
f0276414ad
commit
d2b4e33e1b
1 changed files with 3 additions and 0 deletions
|
@ -913,6 +913,7 @@ class Router {
|
|||
foreach ($_this->__prefixes as $prefix) {
|
||||
if (!empty($url[$prefix])) {
|
||||
$url['action'] = str_replace($prefix . '_', '', $url['action']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -929,6 +930,7 @@ class Router {
|
|||
foreach ($_this->__prefixes as $prefix) {
|
||||
if (isset($url[$prefix])) {
|
||||
array_unshift($urlOut, $prefix);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$output = join('/', $urlOut) . '/';
|
||||
|
@ -964,6 +966,7 @@ class Router {
|
|||
foreach ($_this->__prefixes as $prefix) {
|
||||
if (isset($params[$prefix])) {
|
||||
$output .= $prefix . '/';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!empty($params['plugin']) && $params['plugin'] !== $params['controller']) {
|
||||
|
|
Loading…
Reference in a new issue