States with names containing special characters are not correctly escaped
when generating the select list. Use escape() to fix this.
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
(cherry picked from commit
b3fa0c402e060622a5ed539a465d2fa98b1d2e13)
Signed-off-by: Daniel Axtens <dja@axtens.net>
selected = ' selected="true"'
out += '<option value="%d" %s>%s</option>' % (
- state.id, selected, state.name)
+ state.id, selected, escape(state.name))
out += '</select>'
return mark_safe(out)