Escape 0x00 in javascript_escape().

This is needed in older PyQt-versions.
This commit is contained in:
Florian Bruhin 2015-08-04 12:08:36 +02:00
parent 8ac48699f2
commit 93d27cbb5f

View File

@ -307,6 +307,7 @@ def javascript_escape(text):
('"', r'\"'), # (note it won't hurt when we escape the wrong one).
('\n', r'\n'), # We also need to escape newlines for some reason.
('\r', r'\r'),
('\x00', r'\x00'),
)
for orig, repl in replacements:
text = text.replace(orig, repl)