Browse Source

Merge pull request #44201 from nextcloud/backport/43652/stable28

[stable28] Fixes for getting the filename in the FileInfo class
Ferdinand Thiessen 2 months ago
parent
commit
cd9c0b1c43
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/private/Files/FileInfo.php

+ 3 - 1
lib/private/Files/FileInfo.php

@@ -178,7 +178,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'];
 	}
 
 	/**