mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
040f9cca8b
commit
aa637e1b1d
1 changed files with 8 additions and 15 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue