From 7c6d7d158e1352220a0736e3d122cbdcb19f89be Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 19 Dec 2020 13:10:32 +0000 Subject: [PATCH] Check minimum words length --- filters.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/filters.py b/filters.py index 7bb70eec..408bd360 100644 --- a/filters.py +++ b/filters.py @@ -27,6 +27,10 @@ def addGlobalFilter(baseDir: str, words: str) -> bool: """Adds a global filter for particular words within the content of a incoming posts """ + if not words: + return False + if len(words) < 2: + return False filtersFilename = baseDir + '/accounts/filters.txt' if os.path.isfile(filtersFilename): if words in open(filtersFilename).read():