diff options
author | Eric Wong <e@80x24.org> | 2019-06-04 10:38:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-04 10:38:20 +0000 |
commit | e56b908c0e97c2f479b350dfb0868bc463413b89 (patch) | |
tree | 6b8a8fc59840ebc3e6bee1bbb2e3a5e568bce351 /lib/PublicInbox/MsgTime.pm | |
parent | d5c56e2a1adde279ff86fbd0be81a6b7e5ba0896 (diff) | |
parent | 91af69a41f2963f1f952cb0932ed23cd86cd1093 (diff) | |
download | public-inbox-e56b908c0e97c2f479b350dfb0868bc463413b89.tar.gz |
* charclass: (24 commits) www: require ASCII word characters for CSS filenames www: require ASCII range for mbox downloads githttpbackend: require ASCII in path require ASCII digits for local FS items www: require ASCII digit for git epoch solver|viewdiff: restrict digit matches to ASCII inbox: require ASCII digits for feedmax var filter/rubylang: require ASCII digit for mailcount msgtime: require ASCII digits for parsing dates searchview: do not allow non-ASCII offsets and limits githttpbackend: require Range:, Status: to be ASCII digits view: require YYYYmmDD(HHMMSS) timestamps to be ASCII newswww: only accept ASCII digits as article numbers config: do not accept non-ASCII digits in cgitrc params www: require ASCII filenames in git blob downloads www: only emit ASCII chars in attachment filenames wwwattach: only pass the charset through if ASCII wwwlisting: require ASCII digit for port number http: require SERVER_PORT to be ASCII digit feed: only accept ASCII digits for ref~$N ...
Diffstat (limited to 'lib/PublicInbox/MsgTime.pm')
-rw-r--r-- | lib/PublicInbox/MsgTime.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/MsgTime.pm b/lib/PublicInbox/MsgTime.pm index 62160233..12412825 100644 --- a/lib/PublicInbox/MsgTime.pm +++ b/lib/PublicInbox/MsgTime.pm @@ -44,8 +44,9 @@ sub msg_received_at ($) { my @recvd = $hdr->header_raw('Received'); my ($ts); foreach my $r (@recvd) { - $r =~ /\s*(\d+\s+[[:alpha:]]+\s+\d{2,4}\s+ - \d+\D\d+(?:\D\d+)\s+([\+\-]\d+))/sx or next; + $r =~ /\s*([0-9]+\s+[a-zA-Z]+\s+[0-9]{2,4}\s+ + [0-9]+[^0-9][0-9]+(?:[^0-9][0-9]+) + \s+([\+\-][0-9]+))/sx or next; $ts = eval { str2date_zone($1) } and return $ts; my $mid = $hdr->header_raw('Message-ID'); warn "no date in $mid Received: $r\n"; @@ -59,7 +60,7 @@ sub msg_date_only ($) { my ($ts); foreach my $d (@date) { # Y2K problems: 3-digit years - $d =~ s!([A-Za-z]{3}) (\d{3}) (\d\d:\d\d:\d\d)! + $d =~ s!([A-Za-z]{3}) ([0-9]{3}) ([0-9]{2}:[0-9]{2}:[0-9]{2})! my $yyyy = $2 + 1900; "$1 $yyyy $3"!e; $ts = eval { str2date_zone($d) } and return $ts; if ($@) { |