diff options
author | hopleus <hopleus@gmail.com> | 2024-02-19 16:25:43 +0300 |
---|---|---|
committer | hopleus <hopleus@gmail.com> | 2024-02-19 16:25:43 +0300 |
commit | 1c085a96eb2eed0eadd531348ada75e2eb7fdf62 (patch) | |
tree | 9199b41126517ea915d493b3c06512075b2d6d87 /lib/private/Files/FileInfo.php | |
parent | d52ebaa7cdad68de92bc95d98847c8be0fa73d41 (diff) | |
download | nextcloud-server-1c085a96eb2eed0eadd531348ada75e2eb7fdf62.tar.gz nextcloud-server-1c085a96eb2eed0eadd531348ada75e2eb7fdf62.zip |
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>
Diffstat (limited to 'lib/private/Files/FileInfo.php')
-rw-r--r-- | lib/private/Files/FileInfo.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php index a1f6238db02..86690507088 100644 --- a/lib/private/Files/FileInfo.php +++ b/lib/private/Files/FileInfo.php @@ -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()); } /** |