[Rt-commit] r9648 - rt/branches/3.6-RELEASE/lib/RT

audreyt at bestpractical.com audreyt at bestpractical.com
Mon Nov 12 15:46:10 EST 2007


Author: audreyt
Date: Mon Nov 12 15:46:09 2007
New Revision: 9648

Modified:
   rt/branches/3.6-RELEASE/lib/RT/Transaction_Overlay.pm

Log:
* RT::Transaction->ContentObj - Prefer the first part that
  matches $PreferredContentType, instead of always 'text/plain'.

Modified: rt/branches/3.6-RELEASE/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/Transaction_Overlay.pm	(original)
+++ rt/branches/3.6-RELEASE/lib/RT/Transaction_Overlay.pm	Mon Nov 12 15:46:09 2007
@@ -381,11 +381,12 @@
         return ($Attachment);
     }
 
-    # If it's a multipart object, first try returning the first text/plain part.
+    # If it's a multipart object, first try returning the first part with preferred
+    # MIME type ('text/plain' by default).
 
     elsif ( $Attachment->ContentType() =~ '^multipart/' ) {
         my $plain_parts = $Attachment->Children();
-        $plain_parts->ContentType( VALUE => 'text/plain' );
+        $plain_parts->ContentType( VALUE => ($PreferredContentType || 'text/plain') );
 
         # If we actully found a part, return its content
         if ( $plain_parts->First && $plain_parts->First->Content ne '' ) {


More information about the Rt-commit mailing list