Unverified Commit 2a918621 authored by Dave Miller's avatar Dave Miller Committed by GitHub

Bug 1880288: Noncharacters in comments cause bugmail sending to fail

parent 34673924
......@@ -13,7 +13,7 @@ use 5.14.0;
use parent qw(Email::MIME);
sub new {
my ($class, $msg) = @_;
my ($class, $msg, $args) = @_;
# Template-Toolkit trims trailing newlines, which is problematic when
# parsing headers.
......@@ -52,7 +52,7 @@ sub new {
# you're running on. See http://perldoc.perl.org/perlport.html#Newlines
$msg =~ s/(?:\015+)?\012/\015\012/msg;
return $class->SUPER::new($msg);
return $class->SUPER::new($msg, $args);
}
sub as_string {
......@@ -113,7 +113,7 @@ workarounds.
=head1 SYNOPSIS
use Bugzilla::MIME;
my $email = Bugzilla::MIME->new($message);
my $email = Bugzilla::MIME->new($message, $args);
=head1 DESCRIPTION
......
......@@ -21,6 +21,7 @@ use Bugzilla::MIME;
use Bugzilla::User;
use Bugzilla::Util;
use Encode qw()
use Date::Format qw(time2str);
use Email::Sender::Simple qw(sendmail);
......@@ -61,6 +62,7 @@ sub generate_email {
encoding => 'quoted-printable',
},
body_str => $msg_text,
encode_check => Encode::FB_DEFAULT
));
if ($templates->{html} && $email_format eq 'html') {
$template->process($templates->{html}, $vars, \$msg_html)
......@@ -73,6 +75,7 @@ sub generate_email {
encoding => 'quoted-printable',
},
body_str => $msg_html,
encode_check => Encode::FB_DEFAULT
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment