Skip to content

Commit

Permalink
revert back last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
simogeo committed Feb 8, 2016
1 parent 67417e8 commit 5ac7cb1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions connectors/php/filemanager.class.php
Expand Up @@ -1198,16 +1198,12 @@ private function is_valid_path($path) {
// $this->__log('doc_root : ' . realpath($this->doc_root) . DIRECTORY_SEPARATOR);

// return $this->startsWith($givenpath, $rootpath);
$substrpath = substr(realpath($path) . DIRECTORY_SEPARATOR, 0, strlen($this->path_to_files)) . DIRECTORY_SEPARATOR;
$substrpath = str_replace("//","/",$substrpath); // removing double slash

$rpath = realpath($this->path_to_files) . DIRECTORY_SEPARATOR;
$rpath = str_replace("//","/",$rpath); // removing double slash
$this->__log('substr path_to_files : ' . substr(realpath($path) . DIRECTORY_SEPARATOR, 0, strlen($this->path_to_files)) . DIRECTORY_SEPARATOR);
$this->__log('path_to_files : ' . realpath($this->path_to_files) . DIRECTORY_SEPARATOR);

$this->__log('substr path_to_files : ' . $substrpath);
$this->__log('path_to_files : ' . $rpath);
return (substr(realpath($path) . DIRECTORY_SEPARATOR, 0, strlen(realpath($this->path_to_files))) . DIRECTORY_SEPARATOR) == (realpath($this->path_to_files) . DIRECTORY_SEPARATOR);

return ($substrpath == $rpath);

}

Expand Down Expand Up @@ -1544,4 +1540,4 @@ public function expandPath($path, $clean = false)
return implode('/', $fullPath);
}
}
?>
?>

0 comments on commit 5ac7cb1

Please sign in to comment.