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,6 +376,10 @@ class RedactingFormatter(Formatter):
|
|||
msg = super(RedactingFormatter, self).format(record)
|
||||
self.identify_data_to_redact(msg)
|
||||
for data in self.data_to_redact:
|
||||
# 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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue