diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-08-28 15:02:04 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-08-28 15:02:04 +0000 |
| commit | 353aa39af42bb4d06dabbb60b3ea7471868eee30 (patch) | |
| tree | 00b764698c57713c7f272228b60e58f25e46e536 /roundcubemail/program/steps/mail/func.inc | |
| parent | 0a5eabe762e9c6fc04b0388a854987a3bebabc71 (diff) | |
- Display inline images with known extensions and non-image content-type (#1486934)
git-svn-id: https://svn.roundcube.net/trunk@3916 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/func.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/func.inc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc index ee33e9c1e..a87b7848b 100644 --- a/roundcubemail/program/steps/mail/func.inc +++ b/roundcubemail/program/steps/mail/func.inc @@ -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), |
