Merge pull request #17012 from nextcloud/backport/16999/stable16

[stable16] Return the proper jailed path when requesting the root path
This commit is contained in:
Joas Schilling 2019-10-10 08:57:55 +02:00 committed by GitHub
commit dc4c74a716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,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));