Skip to content

Commit

Permalink
Fix quadratic backtracking on invalid time
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and hsbt committed Mar 24, 2023
1 parent c9b92a6 commit b57db51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ def rfc2822(date)
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+
(\d{2,})\s+
(\d{2})\s*
:\s*(\d{2})\s*
(?::\s*(\d{2}))?\s+
:\s*(\d{2})
(?:\s*:\s*(\d{2}))?\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.
Expand Down

0 comments on commit b57db51

Please sign in to comment.