Merge pull request #7017 from owncloud/trashpreview
Fixed image preview in trashbin subdirs
This commit is contained in:
commit
1f30bffba3
|
@ -34,7 +34,17 @@ try{
|
||||||
if ($view->is_dir($file)) {
|
if ($view->is_dir($file)) {
|
||||||
$mimetype = 'httpd/unix-directory';
|
$mimetype = 'httpd/unix-directory';
|
||||||
} else {
|
} 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->setMimetype($mimetype);
|
||||||
$preview->setMaxX($maxX);
|
$preview->setMaxX($maxX);
|
||||||
|
|
Loading…
Reference in New Issue