From aa637e1b1d4aa2227083aae34dc37e2f4962276e Mon Sep 17 00:00:00 2001 From: gwoo Date: Sat, 29 Dec 2007 21:03:36 +0000 Subject: [PATCH] updating view, fixes #3785 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6277 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/view.php | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 13c79d25f..04eeb9f9a 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -775,22 +775,15 @@ class View extends Object { $name = $this->action; } - if (strpos($name, '/') === false && strpos($name, '..') === false) { + if ($name{0} !== '/' && strpos($name, '..') === false) { $name = $this->viewPath . DS . $subDir . Inflector::underscore($name); - } elseif (strpos($name, '/') !== false) { - if ($name{0} === '/') { - if (is_file($name)) { - return $name; - } - $name = trim($name, '/'); - if (DS !== '/') { - $name = implode(DS, explode('/', $name)); - } - } else { - if (is_file($name)) { - return $name; - } - return $this->_missingView($name, 'missingView'); + } elseif ($name{0} === '/') { + $name = trim($name, '/'); + if (DS !== '/') { + $name = implode(DS, explode('/', $name)); + } + if (is_file($name)) { + return $name; } } elseif (strpos($name, '..') !== false) { $name = explode('/', $name);