Ticket #11362: make_clean_csrf_token_html.diff

File make_clean_csrf_token_html.diff, 732 bytes (added by andriijas, 5 years ago)
  • django/template/defaulttags.py

    diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
    index 6d57cde..2aee9fa 100644
    a b class CsrfTokenNode(Node): 
    4444            if csrf_token == 'NOTPROVIDED':
    4545                return mark_safe(u"")
    4646            else:
    47                 return mark_safe(u"<div style='display:none'><input type='hidden' name='csrfmiddlewaretoken' value='%s' /></div>" % (csrf_token))
     47                return mark_safe(u'<input type="hidden" name="csrfmiddlewaretoken" value="%s" />' % (csrf_token))
    4848        else:
    4949            # It's very probable that the token is missing because of
    5050            # misconfiguration, so we raise a warning
Back to Top