Skip to content

Commit

Permalink
Fix displaying attached images with wrong Content-Type specified (#5527)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Nov 20, 2016
1 parent 5162b20 commit 2441456
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -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
-------------
Expand Down
5 changes: 4 additions & 1 deletion program/steps/mail/get.inc
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2441456

Please sign in to comment.