mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
work around \0 in string
This commit is contained in:
parent
24155cf337
commit
88df74ae9a
1 changed files with 4 additions and 1 deletions
|
@ -368,7 +368,10 @@ class Editor(object):
|
||||||
# focus lost or key/button pressed?
|
# focus lost or key/button pressed?
|
||||||
if str.startswith("blur") or str.startswith("key"):
|
if str.startswith("blur") or str.startswith("key"):
|
||||||
(type, txt) = str.split(":", 1)
|
(type, txt) = str.split(":", 1)
|
||||||
self.note.fields[self.currentField] = self.mungeHTML(txt)
|
txt = self.mungeHTML(txt)
|
||||||
|
# misbehaving apps may include a null byte in the text
|
||||||
|
txt = txt.replace("\x00", "")
|
||||||
|
self.note.fields[self.currentField] = txt
|
||||||
self.mw.requireReset()
|
self.mw.requireReset()
|
||||||
if not self.addMode:
|
if not self.addMode:
|
||||||
self.note.flush()
|
self.note.flush()
|
||||||
|
|
Loading…
Reference in a new issue