summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-06-01 14:10:38 +0200
committerVincent Petry <vincent@nextcloud.com>2022-06-01 18:10:59 +0200
commita704bcf97f9c1baadd3a6f8497bcc9f9c2f4f195 (patch)
tree784b0e0778fe29877c25a45bfac6e88eba0812a8 /lib
parent4e5ed32025398e006f40e819428270d209994e03 (diff)
downloadnextcloud-server-a704bcf97f9c1baadd3a6f8497bcc9f9c2f4f195.tar.gz
nextcloud-server-a704bcf97f9c1baadd3a6f8497bcc9f9c2f4f195.zip
Trim mount point before matching in encryption code
Often times the mount point has a leading slash. This fix sanitizes it to make sure matching works. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Encryption/Util.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php
index 693e24c4721..174af2e8b89 100644
--- a/lib/private/Encryption/Util.php
+++ b/lib/private/Encryption/Util.php
@@ -304,7 +304,7 @@ class Util {
$storageService = \OC::$server->get(GlobalStoragesService::class);
$storages = $storageService->getAllStorages();
foreach ($storages as $storage) {
- if (strpos($path, '/files/' . $storage->getMountPoint()) === 0) {
+ if (strpos($path, '/files/' . ltrim($storage->getMountPoint(), '/')) === 0) {
if ($this->isMountPointApplicableToUser($storage, $uid)) {
return true;
}