summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2014-01-31 07:29:08 -0800
committerGeorg Ehrke <developer@georgehrke.com>2014-01-31 07:29:08 -0800
commit1f30bffba3529c2f5e5be75426392d2b0a4cb46f (patch)
tree8f9ede2d2bc370f0fe13d4bae7e3d5d8aceb3512
parent1a24bf46251e2065c6583aa0b1a4ed49d326f09b (diff)
parentc5767b67b104b21cd551c719131798d0c0626802 (diff)
downloadnextcloud-server-1f30bffba3529c2f5e5be75426392d2b0a4cb46f.tar.gz
nextcloud-server-1f30bffba3529c2f5e5be75426392d2b0a4cb46f.zip
Merge pull request #7017 from owncloud/trashpreview
Fixed image preview in trashbin subdirs
-rw-r--r--apps/files_trashbin/ajax/preview.php14
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
+}