mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
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>
This commit is contained in:
parent
7fba370a75
commit
b71bc1289b
1 changed files with 1 additions and 1 deletions
|
|
@ -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() . '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue