From c88509902ec8443cedcd2b3ddea025a498b4a18a Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 4 Jun 2014 11:26:03 +0200 Subject: [PATCH] Fix mime type returning for "shared with others" files Use "path" instead of "file_target", as the latter is not always set / reliable. --- apps/files_sharing/lib/api.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index dc4e5cf6c4..fbc205da4e 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; }