Skip to content

Commit

Permalink
Fix double DS in cell paths.
Browse files Browse the repository at this point in the history
Refs #5217
  • Loading branch information
markstory committed Nov 21, 2014
1 parent 3be4543 commit ebcd5cf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/View/View.php
Expand Up @@ -803,11 +803,14 @@ public function loadHelper($name, array $config = []) {
* @throws \Cake\View\Exception\MissingTemplateException when a view file could not be found.
*/
protected function _getViewFileName($name = null) {
$subDir = null;
$viewPath = $subDir = '';

if ($this->subDir !== null) {
$subDir = $this->subDir . DS;
}
if ($this->viewPath) {
$viewPath = $this->viewPath . DS;
}

if ($name === null) {
$name = $this->view;
Expand All @@ -817,15 +820,15 @@ protected function _getViewFileName($name = null) {
$name = str_replace('/', DS, $name);

if (strpos($name, DS) === false && $name[0] !== '.') {
$name = $this->viewPath . DS . $subDir . Inflector::underscore($name);
$name = $viewPath . $subDir . Inflector::underscore($name);
} elseif (strpos($name, DS) !== false) {
if ($name[0] === DS || $name[1] === ':') {
if (is_file($name)) {
return $name;
}
$name = trim($name, DS);
} elseif (!$plugin || $this->viewPath !== $this->name) {
$name = $this->viewPath . DS . $subDir . $name;
$name = $viewPath . $subDir . $name;
} else {
$name = DS . $subDir . $name;
}
Expand Down

0 comments on commit ebcd5cf

Please sign in to comment.