mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-04 00:15:09 +01:00
avoid lrf metadata read failure on malformed meta blocks
This commit is contained in:
parent
d8c118cbb4
commit
8bc11e1d91
1 changed files with 2 additions and 1 deletions
|
|
@ -20,6 +20,7 @@
|
|||
from functools import wraps
|
||||
|
||||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
from calibre.utils.cleantext import clean_xml_chars
|
||||
from calibre.ebooks.metadata import MetaInformation, string_to_authors
|
||||
from polyglot.builtins import unicode_type, string_or_bytes
|
||||
|
||||
|
|
@ -400,7 +401,7 @@ def fget(self):
|
|||
yielded unexpected results")
|
||||
|
||||
src = xml_to_unicode(src, strip_encoding_pats=True, resolve_entities=True, assume_utf8=True)[0]
|
||||
return dom.parseString(src)
|
||||
return dom.parseString(clean_xml_chars(src))
|
||||
except zlib.error:
|
||||
raise LRFException("Unable to decompress document meta information")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue