summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-03-14 18:34:46 +0100
committerGitHub <noreply@github.com>2024-03-14 18:34:46 +0100
commita2b924edc686856614678aa9e4af90cd0f7fb6f9 (patch)
treeb6ffa3ad147ea97f30a2a48f4274423d7835bab2
parent0a4b32811c7fd3dca1509a41ad5c7fea1e73eab7 (diff)
parentdeeca104f0486947d53e7582f7e98681d88cf095 (diff)
downloadnextcloud-server-a2b924edc686856614678aa9e4af90cd0f7fb6f9.tar.gz
nextcloud-server-a2b924edc686856614678aa9e4af90cd0f7fb6f9.zip
Merge pull request #44200 from nextcloud/backport/43652/stable27
[stable27] Fixes for getting the filename in the FileInfo class
-rw-r--r--lib/private/Files/FileInfo.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php
index 29922ee30eb..b6a9c868238 100644
--- a/lib/private/Files/FileInfo.php
+++ b/lib/private/Files/FileInfo.php
@@ -183,7 +183,9 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return string
*/
public function getName() {
- return isset($this->data['name']) ? $this->data['name'] : basename($this->getPath());
+ return empty($this->data['name'])
+ ? basename($this->getPath())
+ : $this->data['name'];
}
/**