From c0c8809f69dc55a780f8a55b1adf1f653c87f96f Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 19 Sep 2023 10:54:48 +0200 Subject: [PATCH] fix(sharing): set name to target name in sharing cache Fixes #39879. Signed-off-by: Max --- apps/files_sharing/lib/Cache.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index aa45b6ab43e..20d9765d597 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -154,6 +154,10 @@ class Cache extends CacheJail { } else { $entry['permissions'] = $this->storage->getPermissions($entry['path']); } + + if ($this->storage->getShare()->getNodeId() === $entry['fileid']) { + $entry['name'] = basename($this->storage->getShare()->getTarget()); + } } catch (StorageNotAvailableException $e) { // thrown by FailedStorage e.g. when the sharer does not exist anymore // (IDE may say the exception is never thrown – false negative)