mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
Merge branch 'master' of https://github.com/sebres/fail2ban
* 'master' of https://github.com/sebres/fail2ban: invalid date recognition, irregular because of sorting template list, now via setRegex invalid date recognition, irregular because of sorting template list (sometimes not reproducible by fail2ban-regex, cause will be not sorted)
This commit is contained in:
commit
7813340e1c
1 changed files with 5 additions and 2 deletions
|
|
@ -50,8 +50,11 @@ class DateTemplate:
|
|||
def getName(self):
|
||||
return self.__name
|
||||
|
||||
def setRegex(self, regex):
|
||||
self.__regex = regex.strip()
|
||||
def setRegex(self, regex, wordBegin = True):
|
||||
regex = regex.strip()
|
||||
if (wordBegin and not re.search(r'^\^', regex)):
|
||||
regex = r'\b' + regex
|
||||
self.__regex = regex
|
||||
self.__cRegex = re.compile(regex)
|
||||
|
||||
def getRegex(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue