Skip to content

Commit

Permalink
Applying patch from 'robustsolution' for optimization in Dispatcher::…
Browse files Browse the repository at this point in the history
…dispatch. Fixes #317
  • Loading branch information
markstory committed Nov 22, 2009
1 parent 5d25780 commit a30aec9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cake/dispatcher.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ function dispatch($url = null, $additionalParams = array()) {
))); )));
} }


$privateAction = (bool)(strpos($this->params['action'], '_', 0) === 0); $privateAction = $this->params['action'][0] === '_';
$prefixes = Router::prefixes(); $prefixes = Router::prefixes();


if (!empty($prefixes)) { if (!empty($prefixes)) {
if (isset($this->params['prefix'])) { if (isset($this->params['prefix'])) {
$this->params['action'] = $this->params['prefix'] . '_' . $this->params['action']; $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']); list($prefix, $action) = explode('_', $this->params['action']);
$privateAction = in_array($prefix, $prefixes); $privateAction = in_array($prefix, $prefixes);
} }
Expand Down

0 comments on commit a30aec9

Please sign in to comment.