Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug in [email] tag with reply and html attributes used in conjunc…
…tion.

Thanks to Salvador Caballé for the report.
  • Loading branch information
racke committed Mar 8, 2011
1 parent 46c10ac commit 3e49c76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions code/UserTag/email.tag
Expand Up @@ -59,8 +59,6 @@ sub {
and ::logError("Header injection attempted in email tag: %s", $1);
}

$reply = '' unless defined $reply;
$reply = "Reply-to: $reply\n" if $reply;

for (grep /\S/, split /[\r\n]+/, $extra) {
# require header conformance with RFC 2822 section 2.2
Expand Down Expand Up @@ -106,6 +104,7 @@ sub {
$subject = utf8_to_other($subject, 'MIME-Header');
$cc = utf8_to_other($cc, 'MIME-Header');
$bcc = utf8_to_other($bcc, 'MIME-Header');
$reply = utf8_to_other($reply, 'MIME-Header');
}

my $msg = new MIME::Lite
Expand All @@ -115,6 +114,7 @@ sub {
Type => $opt->{mimetype},
Cc => $cc,
Bcc => $bcc,
'Reply-To' => $reply,
;

for(@extra) {
Expand Down Expand Up @@ -226,6 +226,9 @@ sub {
}
}

$reply = '' unless defined $reply;
$reply = "Reply-to: $reply\n" if $reply;

if ($cc) {
push(@extra, "Cc: $cc");
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Vend/Util.pm
Expand Up @@ -2031,7 +2031,7 @@ sub send_mail {
$to = $1;
}
elsif (/^Reply-to:\s*(.+)/si) {
$reply = $_;
$reply = $1;
}
elsif (/^subj(?:ect)?:\s*(.+)/si) {
$subject = $1;
Expand Down

0 comments on commit 3e49c76

Please sign in to comment.