]> 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:15 +0000 (07:04 -0400)
committerDave Miller <github@justdave.net>
Tue, 3 Sep 2024 15:41:55 +0000 (11:41 -0400)
Co-authored-by: Frédéric Buclin <LpSolit@gmail.com>
Bugzilla/BugMail.pm
Bugzilla/MIME.pm
Bugzilla/Mailer.pm

index fdcbc9d5a20fdcd20252d52101f63190a6f9e3ed..1aff405d8ced619314ef01e9e028b3018d2b0a83 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);
@@ -451,6 +452,7 @@ sub _generate_bugmail {
                 encoding     => 'quoted-printable',
             },
             body_str => $msg_text,
+            encode_check => Encode::FB_DEFAULT
         )
     );
     if ($user->setting('email_format') eq 'html') {
@@ -463,6 +465,7 @@ sub _generate_bugmail {
                 encoding     => 'quoted-printable',
             },
             body_str => $msg_html,
+            encode_check => Encode::FB_DEFAULT
         );
     }
 
index 8c6c141bb7014ed9a732b5cab339ba19a2ff8715..d6046198f17f4384c7db499313d1d563278b03a7 100644 (file)
@@ -14,7 +14,7 @@ use warnings;
 use parent 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 5ccf2d1ed5c0a5ed44447304129e754b0ded1a61..d7c23f8578cd241726fc0b74c4e8015858b7dfc9 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);
@@ -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') {
@@ -73,6 +75,7 @@ sub generate_email {
                 encoding     => 'quoted-printable',
             },
             body_str => $msg_html,
+            encode_check => Encode::FB_DEFAULT
         );
     }