mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
@@ -237,7 +237,12 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
* @author Dmitry (dio) Levashov
|
||||
**/
|
||||
protected function _inpath($path, $parent) {
|
||||
return $path == $parent || strpos($path, $parent.DIRECTORY_SEPARATOR) === 0;
|
||||
$real_path = realpath($path);
|
||||
$real_parent = realpath($parent);
|
||||
if ($real_path && $real_parent) {
|
||||
return $path === $parent || strpos($real_path, $real_parent.DIRECTORY_SEPARATOR) === 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +280,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
// for Inheritance class ( not calling parent::configure() )
|
||||
$this->aroot = realpath($this->root);
|
||||
}
|
||||
if (!$this->_inpath(realpath($path), $this->aroot)) {
|
||||
if (!$this->_inpath($path, $this->aroot)) {
|
||||
return $stat;
|
||||
}
|
||||
|
||||
@@ -367,16 +372,8 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
$target = dirname($path).DIRECTORY_SEPARATOR.$target;
|
||||
}
|
||||
|
||||
$atarget = realpath($target);
|
||||
|
||||
if (!$atarget) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$root = $this->root;
|
||||
$aroot = $this->aroot;
|
||||
|
||||
if ($this->_inpath($atarget, $this->aroot)) {
|
||||
if ($this->_inpath($target, $this->aroot)) {
|
||||
$atarget = realpath($target);
|
||||
return $this->_normpath($this->root.DIRECTORY_SEPARATOR.substr($atarget, strlen($this->aroot)+1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user