mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
f63e0b2bdf
commit
cd0218c3f4
2 changed files with 4 additions and 4 deletions
|
@ -1948,7 +1948,7 @@ class DFAFilter():
|
|||
self.delimit = '\x00'
|
||||
|
||||
def add(self, keyword):
|
||||
if not isinstance(keyword, unicode):
|
||||
if not isinstance(keyword, str):
|
||||
keyword = keyword.decode('utf-8')
|
||||
keyword = keyword.lower()
|
||||
chars = keyword.strip()
|
||||
|
@ -1976,7 +1976,7 @@ class DFAFilter():
|
|||
self.add(keyword.strip())
|
||||
|
||||
def filter(self, message, repl="*"):
|
||||
if not isinstance(message, unicode):
|
||||
if not isinstance(message, str):
|
||||
message = message.decode('utf-8')
|
||||
message = message.lower()
|
||||
ret = []
|
||||
|
|
|
@ -2994,7 +2994,7 @@ class DFAFilter():
|
|||
self.delimit = '\x00'
|
||||
|
||||
def add(self, keyword):
|
||||
if not isinstance(keyword, unicode):
|
||||
if not isinstance(keyword, str):
|
||||
keyword = keyword.decode('utf-8')
|
||||
keyword = keyword.lower()
|
||||
chars = keyword.strip()
|
||||
|
@ -3022,7 +3022,7 @@ class DFAFilter():
|
|||
self.add(keyword.strip())
|
||||
|
||||
def filter(self, message, repl="*"):
|
||||
if not isinstance(message, unicode):
|
||||
if not isinstance(message, str):
|
||||
message = message.decode('utf-8')
|
||||
message = message.lower()
|
||||
ret = []
|
||||
|
|
Loading…
Add table
Reference in a new issue