From a37590b3eb29bf935f750e713ea23d576202921f Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sun, 8 Dec 2013 19:36:21 +1100 Subject: [PATCH] BF: Fix ISO8601 regex to handle [+-]XX timezone offsets --- fail2ban/server/iso8601.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fail2ban/server/iso8601.py b/fail2ban/server/iso8601.py index a53557fb..a28ce13b 100644 --- a/fail2ban/server/iso8601.py +++ b/fail2ban/server/iso8601.py @@ -41,7 +41,7 @@ __all__ = ["parse_date", "ParseError"] # Adapted from http://delete.me.uk/2005/03/iso8601.html ISO8601_REGEX_RAW = "(?P[0-9]{4})-(?P[0-9]{1,2})-(?P[0-9]{1,2})" \ "T(?P[0-9]{2}):(?P[0-9]{2})(:(?P[0-9]{2})(\.(?P[0-9]+))?)?" \ - "(?PZ|(([-+])([0-9]{2}):([0-9]{2})))?" + "(?PZ|[-+][0-9]{2}(:?[0-9]{2})?)?" ISO8601_REGEX = re.compile(ISO8601_REGEX_RAW) TIMEZONE_REGEX = re.compile("(?P[+-])(?P[0-9]{2}):?(?P[0-9]{2})?")