Skip to content

Commit

Permalink
Merge pull request #279 from nopri/master
Browse files Browse the repository at this point in the history
using safestr in web.form.Dropdown._render_option
  • Loading branch information
anandology committed Feb 22, 2014
2 parents cf66831 + 82211db commit d666d65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/form.py
Expand Up @@ -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 = ''
Expand Down

0 comments on commit d666d65

Please sign in to comment.