Code

Ticket #11362: make_clean_csrf_token_html.diff

File make_clean_csrf_token_html.diff, 732 bytes (added by andriijas, 4 years ago)
Line 
1diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
2index 6d57cde..2aee9fa 100644
3--- a/django/template/defaulttags.py
4+++ b/django/template/defaulttags.py
5@@ -44,7 +44,7 @@ class CsrfTokenNode(Node):
6             if csrf_token == 'NOTPROVIDED':
7                 return mark_safe(u"")
8             else:
9-                return mark_safe(u"<div style='display:none'><input type='hidden' name='csrfmiddlewaretoken' value='%s' /></div>" % (csrf_token))
10+                return mark_safe(u'<input type="hidden" name="csrfmiddlewaretoken" value="%s" />' % (csrf_token))
11         else:
12             # It's very probable that the token is missing because of
13             # misconfiguration, so we raise a warning