From 84739652c8647fdeeba7f44467dbcaf20ff964bf Mon Sep 17 00:00:00 2001 From: gwoo Date: Thu, 15 May 2008 23:57:24 +0000 Subject: [PATCH] adding fix for windows paths in view, thanks renan`saddam for reporting and debugging git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6895 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/view.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 3a0d49fbe..85c0d262d 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -766,20 +766,18 @@ class View extends Object { $name = $this->action; } + $name = str_replace('/', DS, $name); if (strpos($name, DS) === false && strpos($name, '..') === false) { $name = $this->viewPath . DS . $subDir . Inflector::underscore($name); } elseif (strpos($name, DS) !== false) { - if ($name{0} === '/' || $name{1} === ':') { + if ($name{0} === DS || $name{1} === ':') { if (is_file($name)) { return $name; } - $name = trim($name, '/'); + $name = trim($name, DS); } else { $name = $this->viewPath . DS . $subDir . $name; } - if (DS !== '/') { - $name = implode(DS, explode('/', $name)); - } } elseif (strpos($name, '..') !== false) { $name = explode('/', $name); $i = array_search('..', $name);