aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Cache.php
diff options
context:
space:
mode:
authorMax <max@nextcloud.com>2023-09-19 10:54:48 +0200
committerJulius Härtl <jus@bitgrid.net>2023-10-18 14:31:27 +0200
commitbe373fca3cb8191ceefb77e05cc93e8c0050549d (patch)
treecb6157e23ce0e87c8f863b134012d0325b121da3 /apps/files_sharing/lib/Cache.php
parentbb912ad47c34e99095477eec9943fe0ec21680b8 (diff)
downloadnextcloud-server-be373fca3cb8191ceefb77e05cc93e8c0050549d.tar.gz
nextcloud-server-be373fca3cb8191ceefb77e05cc93e8c0050549d.zip
fix(sharing): set name to target name in sharing cache
Fixes #39879. Signed-off-by: Max <max@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/lib/Cache.php')
-rw-r--r--apps/files_sharing/lib/Cache.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 594660661ca..af8e722c609 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -162,6 +162,10 @@ class Cache extends CacheJail {
} else {
$entry['permissions'] = $this->storage->getPermissions($entry['path']);
}
+
+ if ($this->share->getNodeId() === $entry['fileid']) {
+ $entry['name'] = basename($this->share->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)