Merge pull request #44200 from nextcloud/backport/43652/stable27

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

View file

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