Make microdata XSS-safe and subevent-aware

This commit is contained in:
Raphael Michel
2017-07-16 17:52:08 +02:00
parent 9c6090a355
commit 8afff29cd4
4 changed files with 35 additions and 27 deletions

View File

@@ -9,3 +9,7 @@ class CustomJSONEncoder(I18nJSONEncoder):
return obj.to_string()
else:
return super().default(obj)
def safe_string(original):
return original.replace("<", "\\u003C").replace(">", "\\u003E")