diff options
author | Robin Appelman <robin@icewind.nl> | 2017-11-10 17:02:35 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-11-10 17:03:27 +0100 |
commit | 56fd462718f2a60d1f9fa2955db28fdc1a5e39b9 (patch) | |
tree | b1e5f33ede62671a46614eb06dcbed611f82764c /lib | |
parent | c7e5bc0f9ab6f58bf9a47dd0c3795e1183419652 (diff) | |
download | nextcloud-server-56fd462718f2a60d1f9fa2955db28fdc1a5e39b9.tar.gz nextcloud-server-56fd462718f2a60d1f9fa2955db28fdc1a5e39b9.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 d477678c277..adee8ced772 100644 --- a/lib/private/Files/Storage/Wrapper/Jail.php +++ b/lib/private/Files/Storage/Wrapper/Jail.php @@ -60,6 +60,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(); } |