mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Don't redact empty string...
This commit is contained in:
parent
2402a1db39
commit
88b414c8f3
1 changed files with 5 additions and 1 deletions
|
@ -376,7 +376,11 @@ class RedactingFormatter(Formatter):
|
||||||
msg = super(RedactingFormatter, self).format(record)
|
msg = super(RedactingFormatter, self).format(record)
|
||||||
self.identify_data_to_redact(msg)
|
self.identify_data_to_redact(msg)
|
||||||
for data in self.data_to_redact:
|
for data in self.data_to_redact:
|
||||||
msg = msg.replace(data, "**********")
|
# we check that data is not empty string,
|
||||||
|
# otherwise this may lead to super epic stuff
|
||||||
|
# (try to run "foo".replace("", "bar"))
|
||||||
|
if data:
|
||||||
|
msg = msg.replace(data, "**********")
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def identify_data_to_redact(self, record):
|
def identify_data_to_redact(self, record):
|
||||||
|
|
Loading…
Add table
Reference in a new issue