Merge pull request #702 from MITx/kimth/fix-dynamath

Escape quotations, lt/gt, ampersand
This commit is contained in:
arjun810
2012-09-16 12:30:22 -07:00

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,