Skip to content

Commit

Permalink
Use cgi.escape for comment escaping.
Browse files Browse the repository at this point in the history
jinja2.escape escapes too much (quote marks) for things
that aren't going to be placed in attribute values.
  • Loading branch information
Amber Yust committed Oct 1, 2010
1 parent 4978e80 commit e326c44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions master/buildbot/status/web/base.py
Expand Up @@ -606,7 +606,7 @@ def replace_from_tuple(t):
link_replace_re = jinja2.Markup(r'<a href="%s"%s>\g<0></a>' % (url_replace, title_replace))

def filter(text, project):
text = jinja2.escape(text)
text = cgi.escape(text)
html = search_re.sub(link_replace_re, text)
return html

Expand All @@ -624,7 +624,7 @@ def dict_filter(text, project):
if t:
return replace_from_tuple(t)(text, project)
else:
return jinja2.escape(text)
return cgi.escape(text)

return dict_filter

Expand All @@ -633,7 +633,7 @@ def dict_filter(text, project):

elif callable(changelink):
def callable_filter(text, project):
text = jinja2.escape(text)
text = cgi.escape(text)
return changelink(text, project)

return callable_filter
Expand Down

0 comments on commit e326c44

Please sign in to comment.