Escape quotations, lt/gt, ampersand

This commit is contained in:
kimth
2012-09-16 14:50:40 -04:00
parent 9b6007fc13
commit 1dfd222b98

View File

@@ -333,6 +333,10 @@ def textline_dynamath(element, value, status, render_template, msg=''):
if '' in preprocessor.values():
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,
'msg': msg, 'hidden': hidden,
'preprocessor': preprocessor,