Merge pull request #1055 from oddstr13/pr-fix-1040-1

Escape null character in log output
This commit is contained in:
Odd Stråbø 2025-10-20 01:14:02 +02:00 committed by GitHub
commit 436b4dbee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,6 +65,10 @@ class LogHandler(logging.StreamHandler):
for token in self.sensitive["Token"]:
string = string.replace(token or "{token}", "{jellyfin-token}")
# Kodi chokes on null-characters in log output, escape it.
if "\x00" in string:
string = string.replace("\x00", "\ufffdx00\ufffd")
xbmc.log(string, level=self.level)
@classmethod