From 35ac61764499c272d2760de2b2a432be412ecede Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Tue, 6 Mar 2018 04:15:38 +0000 Subject: favor Received: date over Date: header globally The first Received: header is believable since it typically hits the user's mail server and can be treated as relatively trustworthy. We still show the Date: in per-message (permalink) views, which may expose users for having incorrect Date: headers, but all the ISO YYYY-MM-DD dates we display will match what we see. --- lib/PublicInbox/View.pm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lib/PublicInbox/View.pm') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index aad67488..f811f4f0 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -6,7 +6,7 @@ package PublicInbox::View; use strict; use warnings; -use Date::Parse qw/str2time/; +use PublicInbox::MsgTime qw(msg_timestamp); use PublicInbox::Hval qw/ascii_html obfuscate_addrs/; use PublicInbox::Linkify; use PublicInbox::MID qw/mid_clean id_compress mid_mime mid_escape/; @@ -732,12 +732,6 @@ sub load_results { $srch->retry_reopen(sub { [ map { $_->mid; $_ } @$msgs ] }); } -sub msg_timestamp { - my ($hdr) = @_; - my $ts = eval { str2time($hdr->header('Date')) }; - defined($ts) ? $ts : 0; -} - sub thread_results { my ($msgs, $srch) = @_; require PublicInbox::SearchThread; -- cgit v1.2.3-24-ge0c7