[rt-devel] Decoding of Subjects broken in 3.0.3pre3 (3.0.3pre2 was OK)

Dmitry Sivachenko mitya at cavia.pp.ru
Wed Jun 11 08:47:33 EDT 2003


Hello!

In 3.0.3pre3 you committed the following patch.  It broke charset recongizing
of Subjects like =?koi8-r?B?1MXT1A==?=
This perfectly valid subject, but after RT processing it becomes '????????'.

When I rollback the following patch, everythink becomes OK.

Please fix!


Thanks!!!



--- rt-3-0-3pre2/lib/RT/Attachment_Overlay.pm   Thu Jun  5 01:22:36 2003
+++ rt-3-0-3pre3/lib/RT/Attachment_Overlay.pm   Wed Jun 11 00:17:58 2003
@@ -146,8 +146,11 @@
             TransactionId => $args{'TransactionId'},
             Parent        => 0,
             ContentType   => $Attachment->mime_type,
-            Headers       => $Attachment->head->as_string,
-            Subject       => $Subject,
+
+            # We need to untaint the data here, because there's a high likelyho
od that some incompetent MUA
+            # Author will try to put bogus non-ascii data in a message header.
+            Headers => Encode::encode( utf8 => $Attachment->head->as_string, En
code::FB_PERLQQ ),
+            Subject => Encode::encode( utf8 => $Subject, Encode::FB_PERLQQ )

         );
         foreach my $part ( $Attachment->parts ) {
@@ -219,14 +222,15 @@
             $Body = MIME::Base64::encode_base64($Body);

         }
-
         my $id = $self->SUPER::Create( TransactionId => $args{'TransactionId'},
                                        ContentType   => $Attachment->mime_type,
                                        ContentEncoding => $ContentEncoding,
                                        Parent          => $args{'Parent'},
+                                       # We need to untaint the data here, beca
use there's a high likelyhood that some incompetent MUA
+                                       # Author will try to put bogus non-ascii
 data in a message header.
+                                       Headers       => Encode::encode(utf8 =>
$Attachment->head->as_string, Encode::FB_PERLQQ),
+                                       Subject       => Encode::encode(utf8 =>
$Subject, Encode::FB_PERLQQ),
                                        Content         => $Body,
-                                       Headers  => $Attachment->head->as_string
,
-                                       Subject  => $Subject,
                                        Filename => $Filename, );
         return ($id);
     }



More information about the Rt-devel mailing list