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:
commit
30d00e63d9
|
@ -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));
|
||||||
|
|
Loading…
Reference in New Issue