diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-01-30 16:55:43 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-01-30 17:03:13 +0100 |
commit | c5767b67b104b21cd551c719131798d0c0626802 (patch) | |
tree | aa637e7f05f6b7d35e43ed7b19d479b71083665f /apps/files_trashbin | |
parent | 299a8285bd2601ccbac988b2e3e9b067d47921a2 (diff) | |
download | nextcloud-server-c5767b67b104b21cd551c719131798d0c0626802.tar.gz nextcloud-server-c5767b67b104b21cd551c719131798d0c0626802.zip |
Fixed image preview in trashbin subdirs
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/ajax/preview.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php index ce432f4d14e..44738734b19 100644 --- a/apps/files_trashbin/ajax/preview.php +++ b/apps/files_trashbin/ajax/preview.php @@ -34,7 +34,17 @@ try{ if ($view->is_dir($file)) { $mimetype = 'httpd/unix-directory'; } else { - $mimetype = \OC_Helper::getFileNameMimeType(pathinfo($file, PATHINFO_FILENAME)); + $pathInfo = pathinfo($file); + $fileName = $pathInfo['basename']; + // if in root dir + if ($pathInfo['dirname'] === '.') { + // cut off the .d* suffix + $i = strrpos($fileName, '.'); + if ($i !== false) { + $fileName = substr($fileName, 0, $i); + } + } + $mimetype = \OC_Helper::getFileNameMimeType($fileName); } $preview->setMimetype($mimetype); $preview->setMaxX($maxX); @@ -45,4 +55,4 @@ try{ }catch(\Exception $e) { \OC_Response::setStatus(500); \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); -}
\ No newline at end of file +} |