mirror of https://github.com/fail2ban/fail2ban
BF: Fix ISO8601 regex to handle [+-]XX timezone offsets
parent
e09b7002e0
commit
a37590b3eb
|
@ -41,7 +41,7 @@ __all__ = ["parse_date", "ParseError"]
|
||||||
# Adapted from http://delete.me.uk/2005/03/iso8601.html
|
# Adapted from http://delete.me.uk/2005/03/iso8601.html
|
||||||
ISO8601_REGEX_RAW = "(?P<year>[0-9]{4})-(?P<month>[0-9]{1,2})-(?P<day>[0-9]{1,2})" \
|
ISO8601_REGEX_RAW = "(?P<year>[0-9]{4})-(?P<month>[0-9]{1,2})-(?P<day>[0-9]{1,2})" \
|
||||||
"T(?P<hour>[0-9]{2}):(?P<minute>[0-9]{2})(:(?P<second>[0-9]{2})(\.(?P<fraction>[0-9]+))?)?" \
|
"T(?P<hour>[0-9]{2}):(?P<minute>[0-9]{2})(:(?P<second>[0-9]{2})(\.(?P<fraction>[0-9]+))?)?" \
|
||||||
"(?P<timezone>Z|(([-+])([0-9]{2}):([0-9]{2})))?"
|
"(?P<timezone>Z|[-+][0-9]{2}(:?[0-9]{2})?)?"
|
||||||
ISO8601_REGEX = re.compile(ISO8601_REGEX_RAW)
|
ISO8601_REGEX = re.compile(ISO8601_REGEX_RAW)
|
||||||
TIMEZONE_REGEX = re.compile("(?P<prefix>[+-])(?P<hours>[0-9]{2}):?(?P<minutes>[0-9]{2})?")
|
TIMEZONE_REGEX = re.compile("(?P<prefix>[+-])(?P<hours>[0-9]{2}):?(?P<minutes>[0-9]{2})?")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue