From 21aaa37175dbf3cf87400e07354a10aad99afa98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Tue, 22 Mar 2022 17:16:34 +0100 Subject: [PATCH] Fix sharing with user-key encryption --- lib/private/Encryption/Util.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php index 59c0f9a11d47..a869fdd558a8 100644 --- a/lib/private/Encryption/Util.php +++ b/lib/private/Encryption/Util.php @@ -235,7 +235,11 @@ public function getUidAndFilename($path) { // strip the first 2 directories (expected to be "//files/path/to/files") // so mountPoint is expected to be "/files/path/to..." $mountPoint = \implode('/', \array_slice($parts, 2)); - $originalPath = "/{$mountPoint}/{$internalPath}"; + if ($mountPoint !== '') { + $originalPath = "/{$mountPoint}/{$internalPath}"; + } else { + $originalPath = "/{$internalPath}"; + } if ($storage->instanceOfStorage('\OCA\Files_Sharing\ISharedStorage')) { // TODO: Improve sharedStorage detection.