[Pkg-owncloud-commits] [owncloud] 20/145: Fixed image preview in trashbin subdirs
David Prévot
taffit at moszumanska.debian.org
Wed Feb 26 16:27:39 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 8a66c30895dc3c1158f5e7955a8fdd8d1361b25d
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Thu Jan 30 16:55:43 2014 +0100
Fixed image preview in trashbin subdirs
---
apps/files_trashbin/ajax/preview.php | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php
index ce432f4..4473873 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
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list