From cb92893598a31bf3af697d65e257a33f6686d6a2 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Tue, 21 Apr 2009 23:44:28 +0000 Subject: [PATCH] [1.0.X] Fixed #10884 - more lenient regexp for matching forms in CSRF post-processing Thanks to Ryszard Szopa for the report and fix Backport of r10617 git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10618 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/csrf/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/csrf/middleware.py b/django/contrib/csrf/middleware.py index 24c1511c91..2c8d97b2e6 100644 --- a/django/contrib/csrf/middleware.py +++ b/django/contrib/csrf/middleware.py @@ -16,7 +16,7 @@ from django.utils.safestring import mark_safe _ERROR_MSG = mark_safe('

403 Forbidden

Cross Site Request Forgery detected. Request aborted.

') _POST_FORM_RE = \ - re.compile(r'(]*\bmethod=(\'|"|)POST(\'|"|)\b[^>]*>)', re.IGNORECASE) + re.compile(r'(]*\bmethod\s*=\s*(\'|"|)POST(\'|"|)\b[^>]*>)', re.IGNORECASE) _HTML_TYPES = ('text/html', 'application/xhtml+xml')