Merge pull request #57924 from nextcloud/carl/fix-external-partialmountprovider

fix(external-storage): Rtrim trailing slash at the end
This commit is contained in:
Andy Scherzinger 2026-02-03 15:57:27 +01:00 committed by GitHub
commit 1bdc27202a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -120,6 +120,7 @@ class DBConfigService {
*/
public function getMountsForUserAndPath(string $userId, array $groupIds, string $path, bool $forChildren): array {
$path = str_replace('/' . $userId . '/files', '', $path);
$path = rtrim($path, '/');
$builder = $this->getSelectQueryBuilder();
$builder->where($builder->expr()->orX(
$builder->expr()->andX( // global mounts

View file

@ -214,7 +214,7 @@ class ConfigAdapterTest extends TestCase {
public function testPartialMountpointExact(): void {
$mountFileInfo = $this->createMock(ICachedMountFileInfo::class);
$mountFileInfo->method('getUser')->willReturn($this->user);
$mountFileInfo->method('getMountPoint')->willReturn('/user1/files/subfolder/subfolder');
$mountFileInfo->method('getMountPoint')->willReturn('/user1/files/subfolder/subfolder/');
$cacheEntry = $this->createMock(ICacheEntry::class);
$result = $this->adapter->getMountsForPath('/user1/files/subfolder/subfolder', true, [