Skip to content

Commit

Permalink
escape XML error messages
Browse files Browse the repository at this point in the history
to avoid any snippets being interpreted as HTML and displayed
  • Loading branch information
christianp committed Aug 24, 2022
1 parent d5877fa commit f699270
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/scripts/xml.js
Expand Up @@ -64,7 +64,7 @@ var xml = Numbas.xml = {
//check for errors
if(Sarissa.getParseErrorText(doc) != Sarissa.PARSED_OK)
{
throw(new Numbas.Error('xml.could not load',{message:Sarissa.getParseErrorText(doc)}));
throw(new Numbas.Error('xml.could not load',{message: Numbas.util.escapeHTML(Sarissa.getParseErrorText(doc))}));
}
//allow XPath to be used to select nodes
doc.setProperty('SelectionLanguage','XPath');
Expand Down

0 comments on commit f699270

Please sign in to comment.