diff options
author | Frédéric Buclin <LpSolit@netscape.net> | 2016-05-15 13:55:11 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@netscape.net> | 2016-05-15 13:55:11 +0200 |
commit | c12c092f9fd84cd0f5b5645f61e29fe1260063dc (patch) | |
tree | 8e6b38a23387a537ad091706e6bef58291842d46 /Bugzilla/MIME.pm | |
parent | a0f06d3134a63b577763e1f272b001182e5e645e (diff) | |
parent | 16dd96bdfdadea63e182f0954f06c187cb83e75b (diff) | |
download | bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.tar bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.tar.gz bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.tar.bz2 bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.tar.xz bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.zip |
Merge branch '5.0' of https://git.mozilla.org/bugzilla/bugzilla
Diffstat (limited to 'Bugzilla/MIME.pm')
-rw-r--r-- | Bugzilla/MIME.pm | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/Bugzilla/MIME.pm b/Bugzilla/MIME.pm index 7b5843a78..8c6c141bb 100644 --- a/Bugzilla/MIME.pm +++ b/Bugzilla/MIME.pm @@ -13,9 +13,6 @@ use warnings; use parent qw(Email::MIME); -use Encode qw(encode); -use Encode::MIME::Header; - sub new { my ($class, $msg) = @_; state $use_utf8 = Bugzilla->params->{'utf8'}; @@ -79,20 +76,12 @@ sub as_string { # MIME-Version must be set otherwise some mailsystems ignore the charset $self->header_set('MIME-Version', '1.0') if !$self->header('MIME-Version'); - # Encode the headers correctly in quoted-printable + # Encode the headers correctly. foreach my $header ($self->header_names) { my @values = $self->header($header); - # We don't recode headers that happen multiple times. - next if scalar(@values) > 1; - if (my $value = $values[0]) { - utf8::decode($value) unless $use_utf8 && utf8::is_utf8($value); - - # avoid excessive line wrapping done by Encode. - local $Encode::Encoding{'MIME-Q'}->{'bpl'} = 998; + map { utf8::decode($_) if defined($_) && !utf8::is_utf8($_) } @values; - my $encoded = encode('MIME-Q', $value); - $self->header_set($header, $encoded); - } + $self->header_str_set($header, @values); } # Ensure the character-set and encoding is set correctly on single part |