summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-01-07 15:27:22 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-01-07 15:27:22 -0500
commita7d4d042239236082d7f2c2679249ea7d48e596c (patch)
tree801d7256fcadfbbc18888cbd2c1ff2c3597a33c6 /apps/files_sharing/lib
parent5174eda23270463f09c82db77f2f61d3496f752f (diff)
downloadnextcloud-server-a7d4d042239236082d7f2c2679249ea7d48e596c.tar.gz
nextcloud-server-a7d4d042239236082d7f2c2679249ea7d48e596c.zip
Fix mimetypes in shared cache
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/cache.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 0534d6dd89f..8b989db3b07 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -79,6 +79,8 @@ class Shared_Cache extends Cache {
$data['size'] = (int)$data['size'];
$data['mtime'] = (int)$data['mtime'];
$data['encrypted'] = (bool)$data['encrypted'];
+ $data['mimetype'] = $this->getMimetype($data['mimetype']);
+ $data['mimepart'] = $this->getMimetype($data['mimepart']);
return $data;
}
return false;
@@ -92,7 +94,12 @@ class Shared_Cache extends Cache {
*/
public function getFolderContents($folder) {
if ($folder == '') {
- return \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_FOLDER_CONTENTS);
+ $files = \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_FOLDER_CONTENTS);
+ foreach ($files as &$file) {
+ $file['mimetype'] = $this->getMimetype($file['mimetype']);
+ $file['mimepart'] = $this->getMimetype($file['mimepart']);
+ }
+ return $files;
} else {
if ($cache = $this->getSourceCache($folder)) {
return $cache->getFolderContents($this->files[$folder]);