[FIX] tools: sanitizer: decode pipe character

Mako uses pipe character in several occasions like |safe to tell an email is
safe. However the sanitizer will encode it, leading to template not correctly
rendered. Like other special characters used in mako, it is now decoded
after sanitize.
This commit is contained in:
Thibault Delavallée
2016-08-31 16:27:55 +02:00
parent 262fe732ba
commit 275ee5825d
+1
View File
@@ -220,6 +220,7 @@ def html_sanitize(src, silent=True, sanitize_tags=True, sanitize_attributes=Fals
cleaned = cleaned.replace('%20', ' ')
cleaned = cleaned.replace('%5B', '[')
cleaned = cleaned.replace('%5D', ']')
cleaned = cleaned.replace('%7C', '|')
cleaned = cleaned.replace('&lt;%', '<%')
cleaned = cleaned.replace('%&gt;', '%>')
except etree.ParserError, e: