- Display inline images with known extensions and non-image content-type (#1486934)

release-0.6
alecpl 14 years ago
parent 2d27641cb5
commit 47d06e46df

@ -13,6 +13,7 @@ CHANGELOG RoundCube Webmail
- Fix TinyMCE uses zh_CN when zh_TW locale is set (#1486929)
- Fix TinyMCE buttons are hidden in Opera (#1486922)
- Fix JS error on IE when trying to send HTML message with enabled spellchecker (#1486940)
- Display inline images with known extensions and non-image content-type (#1486934)
RELEASE 0.4
-----------

@ -1025,7 +1025,13 @@ function rcmail_message_body($attrib)
&& !empty($MESSAGE->attachments))
{
foreach ($MESSAGE->attachments as $attach_prop) {
if (strpos($attach_prop->mimetype, 'image/') === 0) {
// Content-Type: image/*...
if (preg_match('/^image\//i', $attach_prop->mimetype) ||
// ...or known file extension: many clients are using application/octet-stream
($attach_prop->filename &&
preg_match('/^application\/octet-stream$/i', $attach_prop->mimetype) &&
preg_match('/\.(jpg|jpeg|png|gif|bmp)$/i', $attach_prop->filename))
) {
$out .= html::tag('hr') . html::p(array('align' => "center"),
html::img(array(
'src' => $MESSAGE->get_part_url($attach_prop->mime_id),

Loading…
Cancel
Save