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>
pull/32690/head
Vincent Petry 4 years ago
parent 4e5ed32025
commit a704bcf97f
No known key found for this signature in database
GPG Key ID: E055D6A4D513575C
  1. 2
      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;
}

Loading…
Cancel
Save