aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhopleus <hopleus@gmail.com>2024-02-19 16:25:43 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-03-14 14:54:58 +0000
commitabb30aae11f17ed281a0642515fd41909e6b85c4 (patch)
tree06abea80132a0cac1ddf8c90f64bd962e79e0899
parentebf9e0d8a71991d4840e5845d0e45ed017f1b676 (diff)
downloadnextcloud-server-abb30aae11f17ed281a0642515fd41909e6b85c4.tar.gz
nextcloud-server-abb30aae11f17ed281a0642515fd41909e6b85c4.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>
-rw-r--r--lib/private/Files/FileInfo.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php
index 5ba2f27b78b..1471ba971f1 100644
--- a/lib/private/Files/FileInfo.php
+++ b/lib/private/Files/FileInfo.php
@@ -178,7 +178,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());
}
/**