mirror of
https://github.com/nextcloud/server.git
synced 2025-03-12 23:47:25 +00:00
Refactoring getName function
Signed-off-by: hopleus <hopleus@gmail.com>
This commit is contained in:
parent
fe79686255
commit
3a88438bed
1 changed files with 3 additions and 5 deletions
|
@ -185,11 +185,9 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
|||
* @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'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue