summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-04 11:26:03 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-04 11:26:03 +0200
commitc88509902ec8443cedcd2b3ddea025a498b4a18a (patch)
treeb7da7ace9afc53056ab3c224b5d81a7880125b82 /apps/files_sharing
parent3a1994d00149bea6d554c96a3bdee3126cfb17b8 (diff)
downloadnextcloud-server-c88509902ec8443cedcd2b3ddea025a498b4a18a.tar.gz
nextcloud-server-c88509902ec8443cedcd2b3ddea025a498b4a18a.zip
Fix mime type returning for "shared with others" files
Use "path" instead of "file_target", as the latter is not always set / reliable.
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/api.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index dc4e5cf6c49..fbc205da4eb 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -58,10 +58,8 @@ class Api {
return new \OC_OCS_Result(null, 404, 'could not get shares');
} else {
foreach ($shares as &$share) {
- // file_target might not be set if the target user hasn't mounted
- // the filesystem yet
- if ($share['item_type'] === 'file' && isset($share['file_target'])) {
- $share['mimetype'] = \OC_Helper::getFileNameMimeType($share['file_target']);
+ if ($share['item_type'] === 'file' && isset($share['path'])) {
+ $share['mimetype'] = \OC_Helper::getFileNameMimeType($share['path']);
}
$newShares[] = $share;
}