mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Applying patch from 'robustsolution' for optimization in Dispatcher::dispatch. Fixes #317
This commit is contained in:
parent
5d25780b9b
commit
a30aec99fd
1 changed files with 2 additions and 2 deletions
|
@ -136,13 +136,13 @@ class Dispatcher extends Object {
|
|||
)));
|
||||
}
|
||||
|
||||
$privateAction = (bool)(strpos($this->params['action'], '_', 0) === 0);
|
||||
$privateAction = $this->params['action'][0] === '_';
|
||||
$prefixes = Router::prefixes();
|
||||
|
||||
if (!empty($prefixes)) {
|
||||
if (isset($this->params['prefix'])) {
|
||||
$this->params['action'] = $this->params['prefix'] . '_' . $this->params['action'];
|
||||
} elseif (strpos($this->params['action'], '_') !== false && !$privateAction) {
|
||||
} elseif (strpos($this->params['action'], '_') > 0) {
|
||||
list($prefix, $action) = explode('_', $this->params['action']);
|
||||
$privateAction = in_array($prefix, $prefixes);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue