Commit 1dfd222b by kimth

Escape quotations, lt/gt, ampersand

parent 9b6007fc
...@@ -333,6 +333,10 @@ def textline_dynamath(element, value, status, render_template, msg=''): ...@@ -333,6 +333,10 @@ def textline_dynamath(element, value, status, render_template, msg=''):
if '' in preprocessor.values(): if '' in preprocessor.values():
preprocessor = None preprocessor = None
# Escape characters in student input for safe XML parsing
escapedict = {'"': '"'}
value = saxutils.escape(value, escapedict)
context = {'id': eid, 'value': value, 'state': status, 'count': count, 'size': size, context = {'id': eid, 'value': value, 'state': status, 'count': count, 'size': size,
'msg': msg, 'hidden': hidden, 'msg': msg, 'hidden': hidden,
'preprocessor': preprocessor, 'preprocessor': preprocessor,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment