diff --git a/lib/galaxy/tools/toolbox/integrated_panel.py b/lib/galaxy/tools/toolbox/integrated_panel.py index c17d9c8387b..e744064e6bf 100644 --- a/lib/galaxy/tools/toolbox/integrated_panel.py +++ b/lib/galaxy/tools/toolbox/integrated_panel.py @@ -3,6 +3,7 @@ import shutil import tempfile import time import traceback +from xml.sax.saxutils import escape from .panel import ToolPanelElements from .panel import panel_item_types @@ -78,7 +79,7 @@ class ManagesIntegratedToolPanelMixin: section_id = item.id or '' section_name = item.name or '' section_version = item.version or '' - os.write( fd, '
\n' % ( section_id, section_name, section_version ) ) + os.write( fd, '
\n' % ( escape(section_id), escape(section_name), section_version ) ) for section_key, section_item_type, section_item in item.panel_items_iter(): if section_item_type == panel_item_types.TOOL: if section_item: diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index 3478801d726..c857392c123 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -26,6 +26,7 @@ from datetime import datetime from hashlib import md5 from os.path import normpath, relpath from xml.etree import ElementInclude, ElementTree +from xml.etree.ElementTree import ParseError from six import binary_type, iteritems, PY3, string_types, text_type from six.moves import email_mime_text, xrange, zip @@ -40,6 +41,7 @@ except ImportError: docutils_html4css1 = None from .inflection import English, Inflector + inflector = Inflector(English) if PY3: @@ -177,7 +179,11 @@ def parse_xml( fname ): def doctype( *args ): pass tree = ElementTree.ElementTree() - root = tree.parse( fname, parser=ElementTree.XMLParser( target=DoctypeSafeCallbackTarget() ) ) + try: + root = tree.parse( fname, parser=ElementTree.XMLParser( target=DoctypeSafeCallbackTarget() ) ) + except ParseError: + log.exception("Error parsing file %s", fname) + raise ElementInclude.include( root ) return tree