diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-04-25 11:59:48 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-04-25 20:25:10 +0200 |
commit | dadc740db5eb7a5641be842e10c283490fbf4c4d (patch) | |
tree | cab0e2a3f4d819b07a8a309f1ff38dd0a5c318ee /apps/files_trashbin/lib | |
parent | d5937e0fd6098b90cdfc6ea826d2ba7f1f37ad97 (diff) | |
download | nextcloud-server-dadc740db5eb7a5641be842e10c283490fbf4c4d.tar.gz nextcloud-server-dadc740db5eb7a5641be842e10c283490fbf4c4d.zip |
Use getType to determine type of entry
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashFolder.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashFolderFolder.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashHome.php | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_trashbin/lib/Sabre/TrashFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolder.php index 495c98c9202..390f1956ffb 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFolder.php +++ b/apps/files_trashbin/lib/Sabre/TrashFolder.php @@ -51,7 +51,7 @@ class TrashFolder implements ICollection, ITrash { foreach ($entries as $entry) { if ($entry->getName() === $name) { - if ($entry->getMimetype() === 'httpd/unix-directory') { + if ($entry->getType() === FileInfo::TYPE_FOLDER) { return new TrashFolderFolder($this->getName(), $this->userId, $entry, $this->getOriginalLocation()); } return new TrashFolderFile($this->getName(), $this->userId, $entry, $this->getOriginalLocation()); @@ -63,7 +63,7 @@ class TrashFolder implements ICollection, ITrash { $entries = \OCA\Files_Trashbin\Helper::getTrashFiles($this->getName(), $this->userId); $children = array_map(function (FileInfo $entry) { - if ($entry->getMimetype() === 'httpd/unix-directory') { + if ($entry->getType() === FileInfo::TYPE_FOLDER) { return new TrashFolderFolder($this->getName(), $this->userId, $entry, $this->getOriginalLocation()); } return new TrashFolderFile($this->getName(), $this->userId, $entry, $this->getOriginalLocation()); diff --git a/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php index 3607f90c568..435e1f00196 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php +++ b/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php @@ -64,7 +64,7 @@ class TrashFolderFolder implements ICollection, ITrash { foreach ($entries as $entry) { if ($entry->getName() === $name) { - if ($entry->getMimetype() === 'httpd/unix-directory') { + if ($entry->getType() === FileInfo::TYPE_FOLDER) { return new TrashFolderFolder($this->root . '/' . $this->getName(), $this->userId, $entry, $this->getOriginalLocation()); } return new TrashFolderFile($this->root . '/' . $this->getName(), $this->userId, $entry, $this->getOriginalLocation()); @@ -76,7 +76,7 @@ class TrashFolderFolder implements ICollection, ITrash { $entries = \OCA\Files_Trashbin\Helper::getTrashFiles($this->root . '/' . $this->getName(), $this->userId); $children = array_map(function (FileInfo $entry) { - if ($entry->getMimetype() === 'httpd/unix-directory') { + if ($entry->getType() === FileInfo::TYPE_FOLDER) { return new TrashFolderFolder($this->root.'/'.$this->getName(), $this->userId, $entry, $this->getOriginalLocation()); } return new TrashFolderFile($this->root.'/'.$this->getName(), $this->userId, $entry, $this->getOriginalLocation()); diff --git a/apps/files_trashbin/lib/Sabre/TrashHome.php b/apps/files_trashbin/lib/Sabre/TrashHome.php index 0a04755afcb..4b2713ad694 100644 --- a/apps/files_trashbin/lib/Sabre/TrashHome.php +++ b/apps/files_trashbin/lib/Sabre/TrashHome.php @@ -75,7 +75,7 @@ class TrashHome implements ICollection { foreach ($entries as $entry) { if ($entry->getName() . '.d'.$entry->getMtime() === $name) { - if ($entry->getMimetype() === 'httpd/unix-directory') { + if ($entry->getType() === FileInfo::TYPE_FOLDER) { return new TrashFolder('/', $userId, $entry); } return new TrashFile($userId, $entry); @@ -91,7 +91,7 @@ class TrashHome implements ICollection { $entries = \OCA\Files_Trashbin\Helper::getTrashFiles('/', $userId); $children = array_map(function (FileInfo $entry) use ($userId) { - if ($entry->getMimetype() === 'httpd/unix-directory') { + if ($entry->getType() === FileInfo::TYPE_FOLDER) { return new TrashFolder('/', $userId, $entry); } return new TrashFile($userId, $entry); |