From: Andrew Donnellan Date: Fri, 5 Jul 2019 03:27:41 +0000 (+1000) Subject: filters: Escape State names when generating selector HTML X-Git-Tag: v2.1.4~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6774a89048c04ac8cdebf7ba694ea913ec949ce9;p=thirdparty%2Fpatchwork.git filters: Escape State names when generating selector HTML 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 (cherry picked from commit b3fa0c402e060622a5ed539a465d2fa98b1d2e13) Signed-off-by: Daniel Axtens --- diff --git a/patchwork/filters.py b/patchwork/filters.py index 2ddeb18d..1358cc0b 100644 --- a/patchwork/filters.py +++ b/patchwork/filters.py @@ -254,7 +254,7 @@ class StateFilter(Filter): selected = ' selected="true"' out += '' % ( - state.id, selected, state.name) + state.id, selected, escape(state.name)) out += '' return mark_safe(out)