Fix mime type returning for "shared with others" files

Use "path" instead of "file_target", as the latter is not always set /
reliable.
This commit is contained in:
Vincent Petry 2014-06-04 11:26:03 +02:00
parent 3a1994d001
commit c88509902e
1 changed files with 2 additions and 4 deletions

View File

@ -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;
}