fix: update mailer.py ()

This commit is contained in:
蔡泽人 2021-04-19 03:15:07 +08:00 committed by GitHub
parent 33912823e6
commit a7516711c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -406,6 +406,13 @@ def validate_rules(rules):
rule, key)
valid = False
break
try:
re.compile(field['regex'])
except re.error:
LOG.warning('Invalid rule %s, regex %s is not legal',
rule, field['regex'])
valid = False
break
if valid is False:
continue