diff options
author | Eric Wong <e@80x24.org> | 2017-10-02 22:19:16 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-10-03 02:26:11 +0000 |
commit | 2aa29ee6a35f5be2d76c39ccc50bf7a34075e2bd (patch) | |
tree | fdec42427b5096eebc1c0481b147016313dda2f0 /lib/PublicInbox/SearchIdx.pm | |
parent | 2a5b77c0cdd9bb1f726fd05b01d3095b029367ac (diff) | |
download | public-inbox-2aa29ee6a35f5be2d76c39ccc50bf7a34075e2bd.tar.gz |
We should not blindly join References and In-Reply-To headers as a single string, because some messages can have an open angle brace '<' in References: without a corresponding '>'.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r-- | lib/PublicInbox/SearchIdx.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 0824db03..cfb9a088 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -414,9 +414,8 @@ sub link_message { # last References should be IRT, but some mail clients do things # out of order, so trust IRT over References iff IRT exists - my @refs = ($hdr->header_raw('References'), - $hdr->header_raw('In-Reply-To')); - @refs = ((join(' ', @refs)) =~ /<([^>]+)>/g); + my @refs = (($hdr->header_raw('References') || '') =~ /<([^>]+)>/g); + push(@refs, (($hdr->header_raw('In-Reply-To') || '') =~ /<([^>]+)>/g)); my $tid; if (@refs) { |