about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwAtomStream.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-06 04:15:38 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-06 04:51:41 +0000
commit35ac61764499c272d2760de2b2a432be412ecede (patch)
tree4902a8ce21a73c4e3f9b7724fcbadfd5e3038cf7 /lib/PublicInbox/WwwAtomStream.pm
parent8515f32bd403cae734b2fed534a6708758d7949a (diff)
downloadpublic-inbox-35ac61764499c272d2760de2b2a432be412ecede.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/WwwAtomStream.pm')
-rw-r--r--lib/PublicInbox/WwwAtomStream.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/WwwAtomStream.pm b/lib/PublicInbox/WwwAtomStream.pm
index b69de856..bb574a7c 100644
--- a/lib/PublicInbox/WwwAtomStream.pm
+++ b/lib/PublicInbox/WwwAtomStream.pm
@@ -7,11 +7,11 @@ use strict;
 use warnings;
 
 use POSIX qw(strftime);
-use Date::Parse qw(str2time);
 use Digest::SHA qw(sha1_hex);
 use PublicInbox::Address;
 use PublicInbox::Hval qw(ascii_html);
 use PublicInbox::MID qw/mid_clean mid_escape/;
+use PublicInbox::MsgTime qw(msg_timestamp);
 
 # called by PSGI server after getline:
 sub close {}
@@ -108,8 +108,7 @@ sub feed_entry {
                 $irt = '';
         }
         my $href = $base . mid_escape($mid) . '/';
-        my $date = $hdr->header('Date');
-        my $t = eval { str2time($date) } if defined $date;
+        my $t = msg_timestamp($hdr);
         my @t = gmtime(defined $t ? $t : time);
         my $updated = feed_updated(@t);