Dont resolve entities in the RECOVER_PARSER

This commit is contained in:
Kovid Goyal 2019-12-29 18:17:20 +05:30
parent 631f266270
commit d102aca175
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 3 deletions

View File

@ -19,10 +19,9 @@ from calibre.utils.localization import canonicalize_lang
from calibre.utils.logging import default_log
from calibre.utils.zipfile import ZipFile
from calibre.utils.xml_parse import safe_xml_fromstring
from calibre.ebooks.oeb.parse_utils import RECOVER_PARSER
def fromstring(raw, parser=RECOVER_PARSER):
def fromstring(raw, parser=None):
return safe_xml_fromstring(raw)
# Read metadata {{{

View File

@ -16,7 +16,7 @@ from calibre.constants import filesystem_encoding
from calibre.ebooks.chardet import xml_to_unicode, strip_encoding_declarations
from polyglot.builtins import iteritems, itervalues, unicode_type, string_or_bytes, map
RECOVER_PARSER = etree.XMLParser(recover=True, no_network=True)
RECOVER_PARSER = etree.XMLParser(recover=True, no_network=True, resolve_entities=False)
XHTML_NS = 'http://www.w3.org/1999/xhtml'
XMLNS_NS = 'http://www.w3.org/2000/xmlns/'