mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 10:36:16 +00:00
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
This commit is contained in:
parent
de086b1be3
commit
84739652c8
1 changed files with 3 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue