You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using Email::MIME (Version 1.946) that inherits from Email::Simple (Version 2.216). When called like in the following code, the internal crlf character is set to the value of $1:
use Email::MIME;
use Data::Dumper;
my $x = "testvalue";
$x =~ m/^(.+)$/;
my $mime = Email::MIME->new("");
print Dumper($mime);
The problem is in the method _split_head_from_body of Email::Simple:
sub _split_head_from_body {
my ($self, $text_ref) = @_;
# For body/header division, see RFC 2822, section 2.1
#
# Honestly, are we *ever* going to have LFCR messages?? -- rjbs, 2015-10-11
my $re = qr{\x0a\x0d\x0a\x0d|\x0d\x0a\x0d\x0a|\x0d\x0d|\x0a\x0a};
if ($$text_ref =~ /($re)/gsm) {
my $crlf = substr $1, 0, length($1)/2;
return (pos($$text_ref), $crlf);
} else {
# The body is, of course, optional.
my $re = $self->__crlf_re;
$$text_ref =~ /($re)/gsm;
return (undef, ($1 || "\n"));
}
}
In the "else" case it is not checked if the regexp is matching and an existing $1 is used instead of setting the value to "\n". It should be done something like this (the code is not tested):
my $crlf = "\n";
if ( $$text_ref =~ /($re)/gsm ) {
$crlf = $1 || "\n";
}
return (undef, $crlf);
The text was updated successfully, but these errors were encountered:
We are using Email::MIME (Version 1.946) that inherits from Email::Simple (Version 2.216). When called like in the following code, the internal crlf character is set to the value of $1:
The output is
Please note the entry for "myctrlf".
The problem is in the method _split_head_from_body of Email::Simple:
In the "else" case it is not checked if the regexp is matching and an existing $1 is used instead of setting the value to "\n". It should be done something like this (the code is not tested):
The text was updated successfully, but these errors were encountered: