summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-11-05 16:27:43 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-11-05 16:27:43 +0100
commit0277cd7158fe8460268188a8c05cd839b53a1d20 (patch)
tree191833d276a47801d897278369beaf8d54f6db1c /lib
parent9ea65734162191b3222ea9f6e265380ea5175f3a (diff)
downloadnextcloud-server-0277cd7158fe8460268188a8c05cd839b53a1d20.tar.gz
nextcloud-server-0277cd7158fe8460268188a8c05cd839b53a1d20.zip
Properly search the root of a shared external storage
Fixes #1020 When an external storage is shared with you in full the root is '' (empty). This adds an extra check for an empty jail basically. Because if the jail is on the empty string. It matches all paths. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheJail.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php
index 75df45e257b..57f58e7d839 100644
--- a/lib/private/Files/Cache/Wrapper/CacheJail.php
+++ b/lib/private/Files/Cache/Wrapper/CacheJail.php
@@ -94,7 +94,7 @@ class CacheJail extends CacheWrapper {
protected function filterCacheEntry($entry) {
$rootLength = strlen($this->getRoot()) + 1;
- return ($entry['path'] === $this->getRoot()) or (substr($entry['path'], 0, $rootLength) === $this->getRoot() . '/');
+ return $rootLength === 1 || ($entry['path'] === $this->getRoot()) || (substr($entry['path'], 0, $rootLength) === $this->getRoot() . '/');
}
/**