about summary refs log tree commit homepage
path: root/lib/PublicInbox/Feed.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-05-25 01:44:46 +0000
committerEric Wong <e@80x24.org>2016-05-25 01:49:54 +0000
commit23a4e44bedabe5b8b651346cabc2a870c5377a30 (patch)
treee92220e935276cd1a2f466fa4bc6bf1e29fdb8e0 /lib/PublicInbox/Feed.pm
parent64aea34d06f71828b0bdd6ae177b9bcf22d752b4 (diff)
downloadpublic-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 'lib/PublicInbox/Feed.pm')
-rw-r--r--lib/PublicInbox/Feed.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index 6ed00856..81895dbf 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -5,13 +5,13 @@
 package PublicInbox::Feed;
 use strict;
 use warnings;
-use Email::Address;
 use Email::MIME;
 use Date::Parse qw(strptime);
 use PublicInbox::Hval qw/ascii_html/;
 use PublicInbox::Git;
 use PublicInbox::View;
 use PublicInbox::MID qw/mid_clean mid2path/;
+use PublicInbox::Address;
 use POSIX qw/strftime/;
 use constant {
         DATEFMT => '%Y-%m-%dT%H:%M:%SZ', # Atom standard
@@ -86,7 +86,6 @@ sub _no_thread {
 
 sub end_feed {
         my ($fh) = @_;
-        Email::Address->purge_cache;
         $fh->write('</feed>');
         $fh->close;
 }
@@ -171,7 +170,6 @@ sub emit_index_nosrch {
                 PublicInbox::View::index_entry($mime, 0, $state);
                 1;
         });
-        Email::Address->purge_cache;
         $last;
 }
 
@@ -330,9 +328,9 @@ sub add_to_feed {
         $title = title_tag($title);
 
         my $from = $header_obj->header('From') or return 0;
-        my @from = Email::Address->parse($from) or return 0;
-        my $name = ascii_html($from[0]->name);
-        my $email = $from[0]->address;
+        my ($email) = PublicInbox::Address::emails($from);
+        my $name = PublicInbox::Address::from_name($from);
+        $name = ascii_html($name);
         $email = ascii_html($email);
 
         if (delete $feed_opts->{emit_header}) {