updating view, fixes #3785

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6277 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-12-29 21:03:36 +00:00
parent 040f9cca8b
commit aa637e1b1d

View file

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