Merge pull request #16999 from nextcloud/bugfix/noid/getJailedPath-root

Return the proper jailed path when requesting the root path
This commit is contained in:
Roeland Jago Douma 2019-09-04 20:52:10 +02:00 committed by GitHub
commit 30d00e63d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ class Jail extends Wrapper {
public function getJailedPath($path) { public function getJailedPath($path) {
$root = rtrim($this->rootPath, '/') . '/'; $root = rtrim($this->rootPath, '/') . '/';
if (strpos($path, $root) !== 0) { if ($path !== $this->rootPath && strpos($path, $root) !== 0) {
return null; return null;
} else { } else {
$path = substr($path, strlen($this->rootPath)); $path = substr($path, strlen($this->rootPath));