diff options
author | Eric Wong <e@80x24.org> | 2016-05-25 01:44:46 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-05-25 01:49:54 +0000 |
commit | 23a4e44bedabe5b8b651346cabc2a870c5377a30 (patch) | |
tree | e92220e935276cd1a2f466fa4bc6bf1e29fdb8e0 /t | |
parent | 64aea34d06f71828b0bdd6ae177b9bcf22d752b4 (diff) | |
download | public-inbox-23a4e44bedabe5b8b651346cabc2a870c5377a30.tar.gz |
git has stricter requirements for ident names (no '<>') which Email::Address allows. Even in 1.908, Email::Address also has an incomplete fix for CVE-2015-7686 with a DoS-able regexp for comments. Since we don't care for or need all the RFC compliance of Email::Address, avoiding it entirely may be preferable. Email::Address will still be installed as a requirement for Email::MIME, but it is only used by the Email::MIME::header_str_set which we do not use
Diffstat (limited to 't')
-rw-r--r-- | t/mda.t | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -48,6 +48,7 @@ my $mime; local $ENV{GIT_COMMITTER_NAME} = eval { use PublicInbox::MDA; + use PublicInbox::Address; use Encode qw/encode/; my $mbox = 't/utf8.mbox'; open(my $fh, '<', $mbox) or die "failed to open mbox: $mbox\n"; @@ -57,10 +58,9 @@ local $ENV{GIT_COMMITTER_NAME} = eval { $msg = Email::MIME->new($msg->simple->as_string); my $from = $msg->header('From'); - my @from = Email::Address->parse($from); - my $author = $from[0]->name; - my $email = $from[0]->address; - my $date = $msg ->header('Date'); + my $author = PublicInbox::Address::from_name($from); + my ($email) = PublicInbox::Address::emails($from); + my $date = $msg->header('Date'); is('Eléanor', encode('us-ascii', my $tmp = $author, Encode::HTMLCREF), |