Skip to content
Snippets Groups Projects
Commit c5767b67 authored by Vincent Petry's avatar Vincent Petry
Browse files

Fixed image preview in trashbin subdirs

parent 299a8285
Branches
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment