]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1880288: Noncharacters in comments cause bugmail sending to fail
authorDave Miller <justdave@bugzilla.org>
Thu, 29 Aug 2024 11:04:46 +0000 (07:04 -0400)
committerDave Miller <github@justdave.net>
Tue, 3 Sep 2024 14:39:49 +0000 (10:39 -0400)
Co-authored-by: Frédéric Buclin <LpSolit@gmail.com>
Bugzilla/BugMail.pm
Bugzilla/MIME.pm
Bugzilla/Mailer.pm

index 3ab97161375ee4fca0b08e793bee640ed1760ab0..3fd00d5c465e07a270f1154a3445d819d2893458 100644 (file)
@@ -21,6 +21,7 @@ use Bugzilla::Mailer;
 use Bugzilla::Hook;
 use Bugzilla::MIME;
 
+use Encode qw();
 use Date::Parse;
 use Date::Format;
 use Scalar::Util qw(blessed);
@@ -478,6 +479,7 @@ sub _generate_bugmail {
       encoding     => 'quoted-printable',
     },
     body_str => $msg_text,
+    encode_check => Encode::FB_DEFAULT
   ));
 
   if ($user->setting('email_format') eq 'html') {
@@ -491,6 +493,7 @@ sub _generate_bugmail {
         encoding     => 'quoted-printable',
       },
       body_str => $msg_html,
+      encode_check => Encode::FB_DEFAULT
       );
   }
 
index 065166da2750e477bfe3074d7e5354cbf3d2d701..08ec0b0c79458137bce9653132d0eb8dd5b5a701 100644 (file)
@@ -14,7 +14,7 @@ use warnings;
 use base qw(Email::MIME);
 
 sub new {
-  my ($class, $msg) = @_;
+  my ($class, $msg, $args) = @_;
   state $use_utf8 = Bugzilla->params->{'utf8'};
 
   # Template-Toolkit trims trailing newlines, which is problematic when
@@ -54,7 +54,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
 
index 1cd70b1e2de53d8393bb447f85c7a70eef16f056..427b0f9eac48d27601f36cbde5fe1defb1a0f754 100644 (file)
@@ -21,6 +21,7 @@ use Bugzilla::MIME;
 use Bugzilla::Util;
 use Bugzilla::User;
 
+use Encode qw();
 use Date::Format qw(time2str);
 
 use Email::Sender::Simple qw(sendmail);
@@ -62,6 +63,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)
@@ -74,6 +76,7 @@ sub generate_email {
         encoding     => 'quoted-printable',
       },
       body_str => $msg_html,
+      encode_check => Encode::FB_DEFAULT
       );
   }