deal with case that can cause memory errors

This commit is contained in:
AlanCoding
2017-01-31 15:30:39 -05:00
parent f377da0ecb
commit bdc04723b0
3 changed files with 10 additions and 0 deletions

View File

@@ -58,4 +58,6 @@ class PlainTextCleaner(object):
@staticmethod
def remove_sensitive(cleartext, sensitive):
if sensitive == '':
return cleartext
return re.sub(r'%s' % re.escape(sensitive), '$encrypted$', cleartext)