]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
filters: Escape State names when generating selector HTML
authorAndrew Donnellan <ajd@linux.ibm.com>
Fri, 5 Jul 2019 03:27:41 +0000 (13:27 +1000)
committerDaniel Axtens <dja@axtens.net>
Fri, 5 Jul 2019 04:50:21 +0000 (14:50 +1000)
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>
patchwork/filters.py

index e2d2f5958dd4642a19d085c3da951d6308d1e1c7..fb644f98213634fc5d933a6be5e2ef386df328f0 100644 (file)
@@ -262,7 +262,7 @@ class StateFilter(Filter):
                 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)