Fixed #1827 - added 'id' attribute to generated CSRF hidden field. Good call, Ian Holsman.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2899 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2006-05-11 21:55:53 +00:00
parent c427479539
commit c26553c4f9
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ class CsrfMiddleware(object):
# Modify any POST forms
extra_field = "<div style='display:none;'>" + \
"<input type='hidden' name='csrfmiddlewaretoken' value='" + \
"<input type='hidden' id='csrfmiddlewaretoken' name='csrfmiddlewaretoken' value='" + \
csrf_token + "' /></div>"
response.content = _POST_FORM_RE.sub('\\1' + extra_field, response.content)
return response