diff --git a/cake/dispatcher.php b/cake/dispatcher.php index d7363e1c6..651789d8e 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -584,14 +584,10 @@ class Dispatcher extends Object { $themeName = $parts[1]; unset($parts[0], $parts[1]); $fileFragment = implode('/', $parts); - - $viewPaths = App::path('views'); - foreach ($viewPaths as $viewPath) { - $path = $viewPath . 'themed' . DS . $themeName . DS . 'webroot' . DS; - if (file_exists($path . $fileFragment)) { - $assetFile = $path . $fileFragment; - break; - } + + $path = App::themePath($themeName) . 'webroot' . DS; + if (file_exists($path . $fileFragment)) { + $assetFile = $path . $fileFragment; } } else { $plugin = $parts[0]; @@ -648,7 +644,6 @@ class Dispatcher extends Object { include($assetFile); } else { ob_clean(); - flush(); readfile($assetFile); }