From 354716cf60d3c375771fd14f9e79fab4725e0f41 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 23 Jan 2012 20:22:06 -0500 Subject: [PATCH] Fix issues with sparse arrays in ThemeView. Fixes #2500 --- lib/Cake/View/ThemeView.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Cake/View/ThemeView.php b/lib/Cake/View/ThemeView.php index 13cfcafb0..0e5957ba5 100644 --- a/lib/Cake/View/ThemeView.php +++ b/lib/Cake/View/ThemeView.php @@ -57,14 +57,13 @@ class ThemeView extends View { $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);