From 56fd462718f2a60d1f9fa2955db28fdc1a5e39b9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 10 Nov 2017 17:02:35 +0100 Subject: Use the correct root for shared jail when the source storage is also a jail Signed-off-by: Robin Appelman --- lib/private/Files/Storage/Wrapper/Jail.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/private/Files') 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(); } -- cgit v1.2.3