X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FAttachment_Overlay.pm;h=e2707a7cea6cdf2a2df5532cc7f42517b3734800;hb=e70abd21bab68b23488f7ef1ee2e693a3b365691;hp=1d508c0fec4a0af8944cc6e64461a497a209e301;hpb=b4b0c7e72d7eaee2fbfc7022022c9698323203dd;p=freeside.git diff --git a/rt/lib/RT/Attachment_Overlay.pm b/rt/lib/RT/Attachment_Overlay.pm index 1d508c0fe..e2707a7ce 100644 --- a/rt/lib/RT/Attachment_Overlay.pm +++ b/rt/lib/RT/Attachment_Overlay.pm @@ -120,8 +120,9 @@ sub Create { # Get the subject my $Subject = $Attachment->head->get( 'subject', 0 ); - defined($Subject) or $Subject = ''; - chomp($Subject); + $Subject = '' unless defined $Subject; + chomp $Subject; + utf8::decode( $Subject ) unless utf8::is_utf8( $Subject ); #Get the Message-ID my $MessageId = $Attachment->head->get( 'Message-ID', 0 ); @@ -135,7 +136,7 @@ sub Create { # MIME::Head doesn't support perl strings well and can return # octets which later will be double encoded in low-level code my $head = $Attachment->head->as_string; - utf8::decode( $head ); + utf8::decode( $head ) unless utf8::is_utf8( $head ); # If a message has no bodyhandle, that means that it has subparts (or appears to) # and we should act accordingly. @@ -446,24 +447,20 @@ sub Addresses { my %data = (); my $current_user_address = lc $self->CurrentUser->EmailAddress; - my $correspond = lc $self->TransactionObj->TicketObj->QueueObj->CorrespondAddress; - my $comment = lc $self->TransactionObj->TicketObj->QueueObj->CommentAddress; foreach my $hdr (qw(From To Cc Bcc RT-Send-Cc RT-Send-Bcc)) { my @Addresses; - my $line = $self->GetHeader($hdr); + my $line = $self->GetHeader($hdr); foreach my $AddrObj ( Email::Address->parse( $line )) { my $address = $AddrObj->address; $address = lc RT::User->CanonicalizeEmailAddress($address); - next if ( $current_user_address eq $address ); - next if ( $comment eq $address ); - next if ( $correspond eq $address ); - next if ( RT::EmailParser->IsRTAddress($address) ); + next if $current_user_address eq $address; + next if RT::EmailParser->IsRTAddress($address); push @Addresses, $AddrObj ; } - $data{$hdr} = \@Addresses; + $data{$hdr} = \@Addresses; } - return \%data; + return \%data; } =head2 NiceHeaders