Fix displaying attached images with wrong Content-Type specified (#5527)

pull/5530/head
Aleksander Machniak 8 years ago
parent 6287227fff
commit c344f60d75

@ -74,6 +74,7 @@ CHANGELOG Roundcube Webmail
- Fix "Illegal string offset" warning in rcube::log_bug() on PHP 7.1 (#5508)
- Fix storing "empty" values in rcube_cache/rcube_cache_shared (#5519)
- Fix missing content check when image resize fails on attachment thumbnail generation (#5485)
- Fix displaying attached images with wrong Content-Type specified (#5527)
RELEASE 1.2.2
-------------

@ -156,6 +156,10 @@ if (empty($_GET['_thumb']) && $attachment->is_valid()) {
if ($mimetype == 'application/octet-stream' && strpos($real_mimetype, 'image/') === 0 && $valid_extension) {
$mimetype = $real_mimetype;
}
// fix mimetype for images with wrong mimetype
else if (strpos($real_mimetype, 'image/') === 0 && strpos($mimetype, 'image/') === 0) {
$mimetype = $real_mimetype;
}
// "fix" real mimetype the same way the original is before comparison
$real_mimetype = rcmail_fix_mimetype($real_mimetype);

Loading…
Cancel
Save