]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(sharing): set name to target name in sharing cache
authorMax <max@nextcloud.com>
Tue, 19 Sep 2023 08:54:48 +0000 (10:54 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 18 Oct 2023 12:31:27 +0000 (14:31 +0200)
Fixes #39879.

Signed-off-by: Max <max@nextcloud.com>
apps/files_sharing/lib/Cache.php

index 594660661cabbae8ce51078f22581d2850ba73b9..af8e722c609dc876b40528f91c77fb00013f7cd2 100644 (file)
@@ -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)