From f7a44c80f8666e1d95661616cec01d1f030c31d8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 4 May 2013 07:47:12 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/oeb/reader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/reader.py b/src/calibre/ebooks/oeb/reader.py index 6a3747d2d3..eb7e2eca4c 100644 --- a/src/calibre/ebooks/oeb/reader.py +++ b/src/calibre/ebooks/oeb/reader.py @@ -24,6 +24,7 @@ from calibre.ebooks.oeb.base import namespace, barename, XPath, xpath, \ urlnormalize, BINARY_MIME, \ OEBError, OEBBook, DirContainer from calibre.ebooks.oeb.writer import OEBWriter +from calibre.utils.cleantext import clean_xml_chars from calibre.utils.localization import get_lang from calibre.ptempfile import TemporaryDirectory from calibre.constants import __appname__, __version__ @@ -106,7 +107,7 @@ class OEBReader(object): try: opf = etree.fromstring(data) except etree.XMLSyntaxError: - data = xml_replace_entities(data, encoding=None) + data = xml_replace_entities(clean_xml_chars(data), encoding=None) try: opf = etree.fromstring(data) self.logger.warn('OPF contains invalid HTML named entities')