Fixes for getting the file name in the cases when the file name key is received, but it is empty

Signed-off-by: hopleus <hopleus@gmail.com>
pull/43652/head
hopleus 3 months ago
parent d52ebaa7cd
commit 1c085a96eb
No known key found for this signature in database

@ -181,7 +181,11 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return string
*/
public function getName() {
return isset($this->data['name']) ? $this->data['name'] : basename($this->getPath());
if (isset($this->data['name']) && !empty($this->data['name'])) {
return $this->data['name'];
}
return basename($this->getPath());
}
/**

Loading…
Cancel
Save