Fix double body encoding when sending emails. Added tests. Fixes bug #11672.

This commit is contained in:
Colin Kuskie 2010-07-05 11:56:33 -07:00
parent 40e6d7036b
commit aed2c13f52
3 changed files with 47 additions and 5 deletions

View file

@ -98,8 +98,9 @@ Macros in the footer will be evaluated.
sub addFooter {
my $self = shift;
return if $self->{_footerAdded};
my $text = "\n\n".$self->session->setting->get("mailFooter");
WebGUI::Macro::process($self->session, \$text);
my $footer = "\n\n".$self->session->setting->get("mailFooter");
WebGUI::Macro::process($self->session, \$footer);
my $text = encode("utf8", $footer);
$self->{_footerAdded} = 1;
my @parts = $self->getMimeEntity->parts();
##No parts yet, add one with the footer content.
@ -117,7 +118,7 @@ sub addFooter {
Charset => "UTF-8",
Encoding => "quoted-printable",
Type => 'text/plain',
Data => encode('utf8', $body_content),
Data => $body_content,
);
shift @parts;
unshift @parts, $new_part;
@ -130,7 +131,7 @@ sub addFooter {
Charset => "UTF-8",
Encoding => "quoted-printable",
Type => 'text/html',
Data => encode('utf8', $body_content),
Data => $body_content,
);
shift @parts;
unshift @parts, $new_part;