Skip to content

Commit 68b5366

Browse files
committed
detect the correct mimetype of the files in the trashbin, therefore we have to check the filename without the appended timestamp
1 parent f6c7b4e commit 68b5366

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/files_trashbin/lib/Helper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ public static function getTrashFiles($dir, $user, $sortAttribute = '', $sortDesc
7878
$originalPath = substr($originalPath, 0, -1);
7979
}
8080
}
81+
$type = $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file';
8182
$i = array(
8283
'name' => $name,
8384
'mtime' => $timestamp,
84-
'mimetype' => $entry->getMimeType(),
85-
'type' => $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file',
85+
'mimetype' => $type === 'dir' ? 'httpd/unix-directory' : \OC::$server->getMimeTypeDetector()->detectPath($name),
86+
'type' => $type,
8687
'directory' => ($dir === '/') ? '' : $dir,
8788
'size' => $entry->getSize(),
8889
'etag' => '',

0 commit comments

Comments
 (0)