aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-09-09 15:22:19 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2016-09-09 15:36:30 +0200
commit68b53669c01bfa9e39384c81d69a126333b2e3fc (patch)
treecae32c49942b9e71dec2ba1de51ac6e224349910 /apps/files_trashbin
parentf6c7b4e6ebe9c16d4cdd6ac79748bec8eb2dc7eb (diff)
downloadnextcloud-server-68b53669c01bfa9e39384c81d69a126333b2e3fc.tar.gz
nextcloud-server-68b53669c01bfa9e39384c81d69a126333b2e3fc.zip
detect the correct mimetype of the files in the trashbin, therefore we have to check the filename without the appended timestamp
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/Helper.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/Helper.php b/apps/files_trashbin/lib/Helper.php
index 836f799381a..9c312443164 100644
--- a/apps/files_trashbin/lib/Helper.php
+++ b/apps/files_trashbin/lib/Helper.php
@@ -78,11 +78,12 @@ class Helper {
$originalPath = substr($originalPath, 0, -1);
}
}
+ $type = $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file';
$i = array(
'name' => $name,
'mtime' => $timestamp,
- 'mimetype' => $entry->getMimeType(),
- 'type' => $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file',
+ 'mimetype' => $type === 'dir' ? 'httpd/unix-directory' : \OC::$server->getMimeTypeDetector()->detectPath($name),
+ 'type' => $type,
'directory' => ($dir === '/') ? '' : $dir,
'size' => $entry->getSize(),
'etag' => '',