[Pkg-owncloud-commits] [owncloud] 22/52: detect mimetype from the original filename, without the delete timestamp

David Prévot taffit at moszumanska.debian.org
Mon Dec 2 01:49:38 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 863aedf784d582a458c8befd709795f2595e3ba6
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Thu Nov 28 18:59:12 2013 +0100

    detect mimetype from the original filename, without the delete timestamp
---
 apps/files_trashbin/ajax/preview.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php
index a0846b0..9454667 100644
--- a/apps/files_trashbin/ajax/preview.php
+++ b/apps/files_trashbin/ajax/preview.php
@@ -29,8 +29,15 @@ if($maxX === 0 || $maxY === 0) {
 }
 
 try{
-	$preview = new \OC\Preview(\OC_User::getUser(), 'files_trashbin/files');
-	$preview->setFile($file);
+	$preview = new \OC\Preview(\OC_User::getUser(), 'files_trashbin/files', $file);
+	$view = new \OC\Files\View('/'.\OC_User::getUser(). '/files_trashbin/files');
+	if ($view->is_dir($file)) {
+		$mimetype = 'httpd/unix-directory';
+	} else {
+		$mimetype = \OC_Helper::getFileNameMimeType(pathinfo($file, PATHINFO_FILENAME));
+	}
+	$preview->setMimetype($mimetype);
+	$preview->setMimetype($mimetype);
 	$preview->setMaxX($maxX);
 	$preview->setMaxY($maxY);
 	$preview->setScalingUp($scalingUp);

-- 
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