Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix issues with sparse arrays in ThemeView.

Fixes #2500
  • Loading branch information...
commit 354716cf60d3c375771fd14f9e79fab4725e0f41 1 parent c877d17
Mark Story markstory authored
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/Cake/View/ThemeView.php
11 lib/Cake/View/ThemeView.php
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.