From a30aec99fd39978b0532ea6f3e1027f34675af34 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 21 Nov 2009 21:00:15 -0500 Subject: [PATCH] Applying patch from 'robustsolution' for optimization in Dispatcher::dispatch. Fixes #317 --- cake/dispatcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index f09e10997..70790d7a4 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -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); }