diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2016-04-06 01:53:02 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2016-04-06 01:53:02 +0200 |
commit | 60299ec5c0edac882d5552be61e4602e71447af8 (patch) | |
tree | 433bc575bf8ade6aa69eb742cbc1b7919a09aa48 | |
parent | 6c14face26954e4e2b537ba5342c71ae37a6b9b8 (diff) | |
download | bugzilla-60299ec5c0edac882d5552be61e4602e71447af8.tar.gz bugzilla-60299ec5c0edac882d5552be61e4602e71447af8.tar.xz |
Bug 1246228 - Email addresses must not be encoded
r=dkl
-rw-r--r-- | Bugzilla/MIME.pm | 14 | ||||
-rw-r--r-- | Bugzilla/Mailer.pm | 2 | ||||
-rwxr-xr-x | attachment.cgi | 1 |
3 files changed, 3 insertions, 14 deletions
diff --git a/Bugzilla/MIME.pm b/Bugzilla/MIME.pm index 0916133a0..baeaa2ac2 100644 --- a/Bugzilla/MIME.pm +++ b/Bugzilla/MIME.pm @@ -12,8 +12,6 @@ use warnings; use 5.14.0; use parent qw(Email::MIME); -use Encode qw(encode); - sub new { my ($class, $msg) = @_; @@ -78,17 +76,9 @@ sub as_string { # Encode the headers correctly in quoted-printable 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 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 diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index c35f12ef8..28b61b842 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -23,8 +23,6 @@ use Bugzilla::Util; use Date::Format qw(time2str); -use Encode qw(encode); -use Encode::MIME::Header; use Email::Sender::Simple qw(sendmail); use Email::Sender::Transport::SMTP::Persistent; use Bugzilla::Sender::Transport::Sendmail; diff --git a/attachment.cgi b/attachment.cgi index 27a5b66c4..1e1266d29 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -26,6 +26,7 @@ use Bugzilla::Attachment::PatchReader; use Bugzilla::Token; use Encode qw(encode find_encoding); +use Encode::MIME::Header; # Required to alter Encode::Encoding{'MIME-Q'}. use Cwd qw(realpath); # For most scripts we don't make $cgi and $template global variables. But |