diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-03-07 14:27:23 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-03-07 14:27:23 +0100 |
commit | db6fb198fe7b8fa854050730b32d58d3787505b3 (patch) | |
tree | ac81c2855897d52a86f713995cfbdccb6518e1cd /lib | |
parent | 84cf40ed82417f56586c46317b1280065c7091a6 (diff) | |
download | nextcloud-server-db6fb198fe7b8fa854050730b32d58d3787505b3.tar.gz nextcloud-server-db6fb198fe7b8fa854050730b32d58d3787505b3.zip |
don't throw errors in getType
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/fileinfo.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php index 916346b6082..26ea0aab562 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,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { * @return \OCP\Files\FileInfo::TYPE_FILE | \OCP\Files\FileInfo::TYPE_FOLDER */ public function getType() { - if ($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; |