[Rt-commit] rt branch, 4.0/multipart-message-display, created. rt-4.0.6-234-gcce49da

Thomas Sibley trs at bestpractical.com
Mon Jul 2 16:19:32 EDT 2012


The branch, 4.0/multipart-message-display has been created
        at  cce49da4f121218b2c287821d7903299a311430c (commit)

- Log -----------------------------------------------------------------
commit 4a38585f7576a4b8e59448dcce5c8e223e76eeee
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Jun 29 14:33:03 2012 -0700

    Only display textual parts under multipart/related if they're preferred
    
    By restricting textual parts under multipart/related the same way as
    multipart/alternative subparts, we ensure that $PreferRichText controls
    display of the text.  Previously a common MIME structure like so:
    
        multipart/alternative
            text/plain          # text downgraded from HTML by MUA
            multipart/related
                text/html       # composed HTML
                image/png       # inline embedded image for HTML
    
    meant both the text/plain and text/html parts were displayed even if
    $PreferRichText was off.  This looked like "duplicate" messages in
    ticket history.  Now, given the above structure, only one of the text/
    parts will be displayed, depending on the value of $PreferRichText.

diff --git a/share/html/Ticket/Elements/ShowTransactionAttachments b/share/html/Ticket/Elements/ShowTransactionAttachments
index 877201f..b943f4d 100644
--- a/share/html/Ticket/Elements/ShowTransactionAttachments
+++ b/share/html/Ticket/Elements/ShowTransactionAttachments
@@ -175,7 +175,7 @@ my $render_attachment = sub {
             !$ParentObj
 
             # or its parent isn't a multipart alternative
-            || ( $ParentObj->ContentType !~ m{^multipart/alternative$}i )
+            || ( $ParentObj->ContentType !~ m{^multipart/(?:alternative|related)$}i )
 
             # or it's of our prefered alterative type
             || (

commit cce49da4f121218b2c287821d7903299a311430c
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Jun 29 14:50:37 2012 -0700

    Ignore case when looking at Content-Type for $PreferRichText
    
    Most mailers send all lowercase MIME types, but I've seen TEXT/HTML in
    the wild.  RT should be liberal in what it accepts.

diff --git a/share/html/Ticket/Elements/ShowTransactionAttachments b/share/html/Ticket/Elements/ShowTransactionAttachments
index b943f4d..eb56f5c 100644
--- a/share/html/Ticket/Elements/ShowTransactionAttachments
+++ b/share/html/Ticket/Elements/ShowTransactionAttachments
@@ -181,10 +181,10 @@ my $render_attachment = sub {
             || (
                 (
                     RT->Config->Get('PreferRichText')
-                    && ( $message->ContentType =~ m{^text/(?:html|enriched)$} )
+                    && ( $message->ContentType =~ m{^text/(?:html|enriched)$}i )
                 )
                 || ( !RT->Config->Get('PreferRichText')
-                    && ( $message->ContentType !~ m{^text/(?:html|enriched)$} )
+                    && ( $message->ContentType !~ m{^text/(?:html|enriched)$}i )
                 )
             )
         ) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list