Skip to content

Commit

Permalink
Fix issues with sparse arrays in ThemeView.
Browse files Browse the repository at this point in the history
Fixes #2500
  • Loading branch information
markstory committed Jan 24, 2012
1 parent c877d17 commit 354716c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/Cake/View/ThemeView.php
Expand Up @@ -57,14 +57,13 @@ protected function _paths($plugin = null, $cached = true) {
$themePaths = array();

if (!empty($this->theme)) {
$count = count($paths);
for ($i = 0; $i < $count; $i++) {
if (strpos($paths[$i], DS . 'Plugin' . DS) === false
&& strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) {
foreach ($paths as $path) {
if (strpos($path, DS . 'Plugin' . DS) === false
&& strpos($path, DS . 'Cake' . DS . 'View') === false) {
if ($plugin) {
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
$themePaths[] = $path . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
}
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS;
$themePaths[] = $path . 'Themed'. DS . $this->theme . DS;
}
}
$paths = array_merge($themePaths, $paths);
Expand Down

0 comments on commit 354716c

Please sign in to comment.