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>
$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;
}