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>
This commit is contained in:
hopleus 2024-02-19 16:25:43 +03:00 committed by backportbot[bot]
parent 0a4b32811c
commit 591c2cb01a

View file

@ -183,7 +183,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());
}
/**