Skip to content

Commit

Permalink
HTML-escape " for {{GET[foo]}}
Browse files Browse the repository at this point in the history
This makes it possible to use {{GET[foo]}} in attribute values.
  • Loading branch information
zcorpan committed Nov 19, 2015
1 parent b6b082f commit 7d4222f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wptserve/pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def config_replacement(match):

#Should possibly support escaping for other contexts e.g. script
#TODO: read the encoding of the response
return escape(unicode(value)).encode("utf-8")
return escape(unicode(value), quote=True).encode("utf-8")

template_regexp = re.compile(r"{{([^}]*)}}")
new_content, count = template_regexp.subn(config_replacement, content)
Expand Down

0 comments on commit 7d4222f

Please sign in to comment.