summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-30 14:32:05 +0900
committergit <svn-admin@ruby-lang.org>2023-03-30 10:44:39 +0000
commitcbfd02998597f652940def034e490c2428baef09 (patch)
treee40e0a23061cc0c320e663565454daf35942af14
parentaa3885501f89e4927a72ccc1f90ff9cbc4140e17 (diff)
[ruby/time] Make RFC2822 regexp linear
https://hackerone.com/reports/1485501 https://github.com/ruby/time/commit/51034bda4c
-rw-r--r--lib/time.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/time.rb b/lib/time.rb
index 2c85f94cb2..6a13212a49 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -510,7 +510,7 @@ class Time
(\d{2,})\s+
(\d{2})\s*
:\s*(\d{2})
- (?:\s*:\s*(\d{2}))?\s+
+ (?:\s*:\s*(\d\d))?\s+
([+-]\d{4}|
UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|[A-IK-Z])/ix =~ date
# Since RFC 2822 permit comments, the regexp has no right anchor.