Return the proper jailed path when requesting the root path

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-09-04 13:14:53 +02:00 committed by Backportbot
parent d810883587
commit bb70d1096a
1 changed files with 1 additions and 1 deletions

View File

@ -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));