Browse files

Merge pull request #279 from nopri/master

using safestr in web.form.Dropdown._render_option
  • Loading branch information...
2 parents cf66831 + 82211db commit d666d65ea0c15209fd1dc89b28095d04c87a2a6c @anandology anandology committed Feb 22, 2014
Showing with 7 additions and 1 deletion.
  1. +7 −1 web/form.py
View
8 web/form.py
@@ -253,7 +253,13 @@ def _render_option(self, arg, indent=' '):
else:
value, desc = arg, arg
- if self.value == value or (isinstance(self.value, list) and value in self.value):
+ value = utils.safestr(value)
+ if isinstance(self.value, (tuple, list)):
+ s_value = [utils.safestr(x) for x in self.value]
+ else:
+ s_value = utils.safestr(self.value)
+
+ if s_value == value or (isinstance(s_value, list) and value in s_value):
select_p = ' selected="selected"'
else:
select_p = ''

0 comments on commit d666d65

Please sign in to comment.