[Rt-commit] rt branch, 4.0/unicode-transaction-subjects, updated. rt-4.0.5-80-g57ea0c0

Thomas Sibley trs at bestpractical.com
Mon Mar 12 17:08:28 EDT 2012


The branch, 4.0/unicode-transaction-subjects has been updated
       via  57ea0c02eb8fd08b9bab3bbd5a2af1d10fffc685 (commit)
      from  0f8a107abaa6b51fdff9c8df7bbdd3c70539d934 (commit)

Summary of changes:
 lib/RT/Interface/Email.pm |    4 ++--
 lib/RT/Interface/Web.pm   |    2 +-
 lib/RT/Ticket.pm          |    4 +++-
 3 files changed, 6 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 57ea0c02eb8fd08b9bab3bbd5a2af1d10fffc685
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Mar 12 16:04:42 2012 -0400

    Headers we shove into MIME::Head objects should always be octets
    
    We deal with decoding back to Perl strings later if necessary.  These
    are a few places either missed by a6e855c1cf6825d7c95f964afb59779fa4cbfb67
    or added afterwards.
    
    This is really about the internal UTF8 flag on Perl strings.  When we
    add a header with the UTF8 flag ON we end up double-encoding other
    headers during insert when they're concatenated together.  This is why
    we still call encode_utf8 on strings which should never have UTF8
    characters in them anyway (Message-Id, for example).

diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index 909a9f4..164de74 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1201,8 +1201,8 @@ sub SetInReplyTo {
         if @references > 10;
 
     my $mail = $args{'Message'};
-    $mail->head->set( 'In-Reply-To' => join ' ', @rtid? (@rtid) : (@id) ) if @id || @rtid;
-    $mail->head->set( 'References' => join ' ', @references );
+    $mail->head->set( 'In-Reply-To' => Encode::encode_utf8(join ' ', @rtid? (@rtid) : (@id)) ) if @id || @rtid;
+    $mail->head->set( 'References' => Encode::encode_utf8(join ' ', @references) );
 }
 
 sub ParseTicketId {
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 39c0c8c..9a0fa06 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1688,7 +1688,7 @@ sub MakeMIMEEntity {
     );
     my $Message = MIME::Entity->build(
         Type    => 'multipart/mixed',
-        "Message-Id" => RT::Interface::Email::GenMessageId,
+        "Message-Id" => Encode::encode_utf8( RT::Interface::Email::GenMessageId ),
         map { $_ => Encode::encode_utf8( $args{ $_} ) }
             grep defined $args{$_}, qw(Subject From Cc)
     );
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 3f2e94c..c4ab64d 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -2235,7 +2235,9 @@ sub _RecordNote {
     my $msgid = $args{'MIMEObj'}->head->get('Message-ID');
     unless (defined $msgid && $msgid =~ /<(rt-.*?-\d+-\d+)\.(\d+-0-0)\@\Q$org\E>/) {
         $args{'MIMEObj'}->head->set(
-            'RT-Message-ID' => RT::Interface::Email::GenMessageId( Ticket => $self )
+            'RT-Message-ID' => Encode::encode_utf8(
+                RT::Interface::Email::GenMessageId( Ticket => $self )
+            )
         );
     }
 

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


More information about the Rt-commit mailing list