diff options
author | Robin Appelman <robin@icewind.nl> | 2017-11-10 17:02:35 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-11-28 13:55:42 +0100 |
commit | 6d8de960c9773863db0df489028cee4b046c4a1b (patch) | |
tree | daa1c86d79aca62a5bc82f70f032d4cadebfa8cc /lib | |
parent | 036eae6956ca4a53c7487be10494574bace0ce79 (diff) | |
download | nextcloud-server-6d8de960c9773863db0df489028cee4b046c4a1b.tar.gz nextcloud-server-6d8de960c9773863db0df489028cee4b046c4a1b.zip |
Use the correct root for shared jail when the source storage is also a jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Jail.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Jail.php b/lib/private/Files/Storage/Wrapper/Jail.php index 4fa2428c968..d7f244b7d31 100644 --- a/lib/private/Files/Storage/Wrapper/Jail.php +++ b/lib/private/Files/Storage/Wrapper/Jail.php @@ -58,6 +58,17 @@ class Jail extends Wrapper { } } + public function getJailedPath($path) { + $root = rtrim($this->rootPath, '/') . '/'; + + if (strpos($path, $root) !== 0) { + return null; + } else { + $path = substr($path, strlen($this->rootPath)); + return trim($path, '/'); + } + } + public function getId() { return parent::getId(); } |