diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-11-23 12:03:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-23 12:03:36 +0100 |
commit | 106d932e8fe3adbaec1e3d74b28cc0ebbc154823 (patch) | |
tree | 4db43e042efce23ec0a1c1eaa05766767b482d4b /lib/private/Files | |
parent | b6a39b79278df848af388506cce394671a414f19 (diff) | |
parent | 56fd462718f2a60d1f9fa2955db28fdc1a5e39b9 (diff) | |
download | nextcloud-server-106d932e8fe3adbaec1e3d74b28cc0ebbc154823.tar.gz nextcloud-server-106d932e8fe3adbaec1e3d74b28cc0ebbc154823.zip |
Merge pull request #7137 from nextcloud/shared-jailed-source-root
Use the correct root for shared jail when the source storage is also a jail
Diffstat (limited to 'lib/private/Files')
-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(); } |