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

[stable28] Fixes for getting the filename in the FileInfo class
This commit is contained in:
Ferdinand Thiessen 2024-03-14 18:34:34 +01:00 committed by GitHub
commit cd9c0b1c43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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