fix(sharing): set name to target name in sharing cache

Fixes #39879.

Signed-off-by: Max <max@nextcloud.com>
This commit is contained in:
Max 2023-09-19 10:54:48 +02:00 committed by Julius Härtl
parent bb912ad47c
commit be373fca3c
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View 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)