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
This commit is contained in:
gwoo 2007-12-29 21:20:48 +00:00
parent 3b1b182873
commit a1198bb3b7

View file

@ -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));
}