diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-12-17 17:07:48 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-12-17 17:07:48 +0100 |
commit | ecdf88e41b898889fe8e05bb9c05415dd6b03a95 (patch) | |
tree | 735f9198dad871e9dd6459f4ccd5dc986937c594 /apps/files_sharing | |
parent | 3818a055b96a528263585b93f598fb479b5a1ec4 (diff) | |
download | nextcloud-server-ecdf88e41b898889fe8e05bb9c05415dd6b03a95.tar.gz nextcloud-server-ecdf88e41b898889fe8e05bb9c05415dd6b03a95.zip |
Use proper public API for OC_Helper::getFileNameMimeType
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/api/local.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files_sharing/api/local.php b/apps/files_sharing/api/local.php index aaafafb269f..5b2f2e06e75 100644 --- a/apps/files_sharing/api/local.php +++ b/apps/files_sharing/api/local.php @@ -64,9 +64,10 @@ class Local { if ($shares === false) { return new \OC_OCS_Result(null, 404, 'could not get shares'); } else { + $mimetypeDetector = \OC::$server->getMimeTypeDetector(); foreach ($shares as &$share) { if ($share['item_type'] === 'file' && isset($share['path'])) { - $share['mimetype'] = \OC_Helper::getFileNameMimeType($share['path']); + $share['mimetype'] = $mimetypeDetector->detectPath($share['path']); if (\OC::$server->getPreviewManager()->isMimeSupported($share['mimetype'])) { $share['isPreviewAvailable'] = true; } @@ -227,9 +228,10 @@ class Local { private static function getFilesSharedWithMe() { try { $shares = \OCP\Share::getItemsSharedWith('file'); + $mimetypeDetector = \OC::$server->getMimeTypeDetector(); foreach ($shares as &$share) { if ($share['item_type'] === 'file') { - $share['mimetype'] = \OC_Helper::getFileNameMimeType($share['file_target']); + $share['mimetype'] = $mimetypeDetector->detectPath($share['file_target']); if (\OC::$server->getPreviewManager()->isMimeSupported($share['mimetype'])) { $share['isPreviewAvailable'] = true; } |