Use format_html for HTML-generating functions
Closed this issue · 1 comments
jardiacaj commented
Currently the regular str.format() function is used in HTML-generating functions. For example:
finem_imperii/world/models/geography.py
Line 71 in 8ba540c
This forces to use the |safe tag in templates when outputting the result, which creates XSS vulnerabilities. For example:
A better solution would be to use django.utils.html.format_html(): https://docs.djangoproject.com/en/1.11/ref/utils/#django.utils.html.format_html
jardiacaj commented
This issue is now fixed. Thanks a lot for your help!