瀏覽代碼

Don't die on broken regexes.

tags/v0.2
Ben Kurtovic 9 年之前
父節點
當前提交
09319b1675
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. +4
    -1
      earwigbot/wiki/copyvios/exclusions.py

+ 4
- 1
earwigbot/wiki/copyvios/exclusions.py 查看文件

@@ -182,7 +182,10 @@ class ExclusionsDB(object):
excl_path = excl[excl.index("/") + 1]
matches = excl_path.startswith(parsed.path)
elif excl.startswith("re:"):
matches = re.match(excl[3:], normalized)
try:
matches = re.match(excl[3:], normalized)
except re.error:
continue
else:
matches = normalized.startswith(excl)
if matches:


Loading…
取消
儲存