From a1198bb3b7c7fa7c88bac11c44f80df543865cf8 Mon Sep 17 00:00:00 2001 From: gwoo Date: Sat, 29 Dec 2007 21:20:48 +0000 Subject: [PATCH] reverting previous changes and updating view, fixes #3785 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6279 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/view.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 816cc01cf..e46f77df7 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -775,13 +775,17 @@ class View extends Object { $name = $this->action; } - if ($name{0} !== '/' && strpos($name, '..') === false) { + if (strpos($name, '/') === false && strpos($name, '..') === false) { $name = $this->viewPath . DS . $subDir . Inflector::underscore($name); - } elseif ($name{0} === '/') { - if (is_file($name)) { - return $name; + } elseif (strpos($name, '/') !== false) { + if ($name{0} === '/') { + if (is_file($name)) { + return $name; + } + $name = trim($name, '/'); + } else { + $name = $this->viewPath . DS . $subDir . $name; } - $name = trim($name, '/'); if (DS !== '/') { $name = implode(DS, explode('/', $name)); }