[freeside-commits] branch FREESIDE_3_BRANCH updated. 57d4a5ffe7b86d032339d6eefe1a22277f3ca113
Ivan
ivan at 420.am
Tue Oct 17 14:44:13 PDT 2017
The branch, FREESIDE_3_BRANCH has been updated
via 57d4a5ffe7b86d032339d6eefe1a22277f3ca113 (commit)
from e49ae07876b2f0254875581e525f8aee208ca1d1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 57d4a5ffe7b86d032339d6eefe1a22277f3ca113
Author: Ivan Kohler <ivan at freeside.biz>
Date: Tue Oct 17 14:44:08 2017 -0700
fix MIME::Entity usage for perl 5.18+, RT#77890
diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm
index ff5723f..ed4b103 100644
--- a/FS/FS/Misc.pm
+++ b/FS/FS/Misc.pm
@@ -156,7 +156,11 @@ sub send_email {
unshift @mimeparts, {
'Type' => ( $options{'content-type'} || 'text/plain' ),
- 'Data' => $options{'body'},
+ 'Charset' => 'UTF-8',
+ 'Data' => ( $options{'content-type'} =~ /^text\//
+ ? Encode::encode_utf8( $options{'body'} )
+ : $options{'body'}
+ ),
'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ),
'Disposition' => 'inline',
};
@@ -165,7 +169,10 @@ sub send_email {
@mimeargs = (
'Type' => ( $options{'content-type'} || 'text/plain' ),
- 'Data' => $options{'body'},
+ 'Data' => ( $options{'content-type'} =~ /^text\//
+ ? Encode::encode_utf8( $options{'body'} )
+ : $options{'body'}
+ ),
'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ),
);
@@ -373,7 +380,7 @@ sub generate_email {
'Type' => 'text/plain',
'Encoding' => 'quoted-printable',
#'Encoding' => '7bit',
- 'Data' => $data,
+ 'Data' => Encode::encode_utf8($data),
'Disposition' => 'inline',
);
@@ -394,7 +401,7 @@ sub generate_email {
' </title>',
' </head>',
' <body bgcolor="#ffffff">',
- @html_data,
+ ( map Encode::encode_utf8($_), @html_data ),
' </body>',
'</html>',
],
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 70bc4fb..c97e84e 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2107,6 +2107,7 @@ Returns an argument list to be passed to L<FS::Misc::send_email>.
=cut
use MIME::Entity;
+use Encode;
sub generate_email {
@@ -2174,7 +2175,7 @@ sub generate_email {
if $DEBUG;
# 'print_text' argument is no longer used
- @text = $self->print_text(\%args);
+ @text = map Encode::encode_utf8($_), $self->print_text(\%args);
} else {
@@ -2269,7 +2270,7 @@ sub generate_email {
' </title>',
' </head>',
' <body bgcolor="#e8e8e8">',
- $html,
+ Encode::encode_utf8($html),
' </body>',
'</html>',
],
diff --git a/FS/FS/TicketSystem/RT_Internal.pm b/FS/FS/TicketSystem/RT_Internal.pm
index d858127..0676155 100644
--- a/FS/FS/TicketSystem/RT_Internal.pm
+++ b/FS/FS/TicketSystem/RT_Internal.pm
@@ -5,6 +5,7 @@ use vars qw( @ISA $DEBUG $me );
use Data::Dumper;
use Date::Format qw( time2str );
use MIME::Entity;
+use Encode;
use FS::UID qw(dbh);
use FS::CGI qw(popurl);
use FS::TicketSystem::RT_Libs;
@@ -374,7 +375,7 @@ sub create_ticket {
: ( $param{'cc'} ? [ $param{'cc'} ] : [] );
my $mimeobj = MIME::Entity->build(
- 'Data' => $param{'message'},
+ 'Data' => Encode::encode_utf8( $param{'message'} ),
'Type' => ( $param{'mime_type'} || 'text/plain' ),
);
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Misc.pm | 15 +++++++++++----
FS/FS/Template_Mixin.pm | 5 +++--
FS/FS/TicketSystem/RT_Internal.pm | 3 ++-
3 files changed, 16 insertions(+), 7 deletions(-)
More information about the freeside-commits
mailing list