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

pull/5754/head
Aleksander Machniak 8 years ago
parent 5162b20986
commit 2441456597

@ -15,6 +15,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
-------------

@ -180,6 +180,10 @@ if (strlen($part_id)) {
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);
@ -226,7 +230,6 @@ if (strlen($part_id)) {
}
}
// TIFF to JPEG conversion, if needed
$tiff_support = !empty($_SESSION['browser_caps']) && !empty($_SESSION['browser_caps']['tif']);
if (!empty($_REQUEST['_embed']) && !$tiff_support

Loading…
Cancel
Save