Skip to content

Commit

Permalink
fix(sharing): set name to target name in sharing cache
Browse files Browse the repository at this point in the history
Fixes #39879.

Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud authored and backportbot-nextcloud[bot] committed Oct 23, 2023
1 parent dc19882 commit 31978f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/files_sharing/lib/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ protected function formatCacheEntry($entry, $path = null) {
} 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)
Expand Down

0 comments on commit 31978f4

Please sign in to comment.