Merge pull request #17013 from nextcloud/backport/16999/stable15

[stable15] Return the proper jailed path when requesting the root path
pull/17540/head
Joas Schilling 2019-10-10 08:58:09 +07:00 committed by GitHub
commit 0174577164
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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