Added escape() to catalog title included in OPF metadata header to deal with potential inclusion of illegal HTML. Bug was caused by an ampersand in the title.

This commit is contained in:
GRiker 2012-11-12 14:19:49 -07:00
parent a3ee82fe3d
commit 8e3fa60d34
2 changed files with 3 additions and 3 deletions

View File

@ -408,8 +408,8 @@ class EPUB_MOBI(CatalogPlugin):
# Run ebook-convert
from calibre.ebooks.conversion.plumber import Plumber
plumber = Plumber(os.path.join(catalog.catalog_path,
opts.basename + '.opf'), path_to_output, log, report_progress=notification,
plumber = Plumber(os.path.join(catalog.catalog_path, opts.basename + '.opf'),
path_to_output, log, report_progress=notification,
abort_after_input_dump=False)
plumber.merge_ui_recommendations(recommendations)
plumber.run()

View File

@ -3905,7 +3905,7 @@ class CatalogBuilder(object):
mtc = 0
titleTag = Tag(soup, "dc:title")
titleTag.insert(0,self.opts.catalog_title)
titleTag.insert(0,escape(self.opts.catalog_title))
metadata.insert(mtc, titleTag)
mtc += 1