Skip to content

Commit

Permalink
Refactoring getName function
Browse files Browse the repository at this point in the history
Signed-off-by: hopleus <hopleus@gmail.com>
  • Loading branch information
hopleus authored and backportbot[bot] committed Mar 14, 2024
1 parent 591c2cb commit deeca10
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/private/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,9 @@ public function getMimePart() {
* @return string
*/
public function getName() {
if (isset($this->data['name']) && !empty($this->data['name'])) {
return $this->data['name'];
}

return basename($this->getPath());
return empty($this->data['name'])
? basename($this->getPath())
: $this->data['name'];
}

/**
Expand Down

0 comments on commit deeca10

Please sign in to comment.