Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-07 17:52:44 +0400
committerRobin Appelman <icewind@owncloud.com>2014-03-07 17:52:44 +0400
commit65f52fee4f333cc31591a265c2d5b4c0ed0d7016 (patch)
treebc31cf6ed66fa1483507ee49e48b8b2ab9c6923c /lib/private/files/fileinfo.php
parent1785c0c9b9fcdc6e9a8e58f13f45e5b53364882a (diff)
Fix FileInfo->getType errors
Diffstat (limited to 'lib/private/files/fileinfo.php')
-rw-r--r--lib/private/files/fileinfo.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php
index 2dbdd80a26b..a9e64fe1533 100644
--- a/lib/private/files/fileinfo.php
+++ b/lib/private/files/fileinfo.php
@@ -53,6 +53,9 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
}
public function offsetGet($offset) {
+ if ($offset === 'type') {
+ return $this->getType();
+ }
return $this->data[$offset];
}
@@ -144,7 +147,11 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return \OCP\Files\FileInfo::TYPE_FILE | \OCP\Files\FileInfo::TYPE_FOLDER
*/
public function getType() {
- return $this->data['type'];
+ if (isset($this->data['type'])) {
+ return $this->data['type'];
+ } else {
+ return $this->getMimetype() === 'httpd/unix-directory' ? self::TYPE_FOLDER : self::TYPE_FILE;
+ }
}
public function getData(){