[Svn] r3916 - in trunk/roundcubemail: . program/steps/mail

trac at roundcube.net trac at roundcube.net
Sat Aug 28 17:02:04 CEST 2010


Author: alec
Date: 2010-08-28 10:02:04 -0500 (Sat, 28 Aug 2010)
New Revision: 3916

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/steps/mail/func.inc
Log:
- Display inline images with known extensions and non-image content-type (#1486934)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-08-28 14:34:05 UTC (rev 3915)
+++ trunk/roundcubemail/CHANGELOG	2010-08-28 15:02:04 UTC (rev 3916)
@@ -13,6 +13,7 @@
 - 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
 -----------

Modified: trunk/roundcubemail/program/steps/mail/func.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/func.inc	2010-08-28 14:34:05 UTC (rev 3915)
+++ trunk/roundcubemail/program/steps/mail/func.inc	2010-08-28 15:02:04 UTC (rev 3916)
@@ -1025,7 +1025,13 @@
       && !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),

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list