diff options
author | Eric Wong <e@80x24.org> | 2016-07-06 00:36:59 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-06 07:12:45 +0000 |
commit | acac0cfb3afa26fd6556aa9f835869febcda97d8 (patch) | |
tree | b8b4df471634320c2a55e2536761e474a9a99b04 /lib/PublicInbox | |
parent | c952a7208d9941495a9efbe83d0e4af866f05a64 (diff) | |
download | public-inbox-acac0cfb3afa26fd6556aa9f835869febcda97d8.tar.gz |
They're uncommon, fortunately, but we make no attempt to handle nested comments (which would open us up to things like CVE-2015-7686) or use the comment in place of a missing name.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/Address.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/Address.pm b/lib/PublicInbox/Address.pm index e17d0b57..2c0bb040 100644 --- a/lib/PublicInbox/Address.pm +++ b/lib/PublicInbox/Address.pm @@ -7,7 +7,9 @@ use warnings; # very loose regexes, here. We don't need RFC-compliance, # just enough to make thing sanely displayable and pass to git -sub emails { ($_[0] =~ /([\w\.\+=\-]+\@[\w\.\-]+)>?\s*(?:,\s*|\z)/g) } +sub emails { + ($_[0] =~ /([\w\.\+=\-]+\@[\w\.\-]+)>?\s*(?:\(.*?\))?(?:,\s*|\z)/g) +} sub names { map { @@ -19,7 +21,7 @@ sub names { $e = $_ =~ /\S/ ? $_ : $e; $e =~ s/\@\S+\z//; $e; - } split(/\@+[\w\.\-]+>?\s*(?:,\s*|\z)/, $_[0]); + } split(/\@+[\w\.\-]+>?\s*(?:\(.*?\))?(?:,\s*|\z)/, $_[0]); } 1; |