From 6590061a005b8772baee1a94d7799bcb58d9841d Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 16 Apr 2009 14:25:18 +0000 Subject: Fixed #9948 -- Corrected URLField validation to match RFC1035 (URL analog of #9890). Thanks to kratorius for the report and fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10574 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/forms/fields.py') diff --git a/django/forms/fields.py b/django/forms/fields.py index ab3fe67aeb..3ff2819571 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -533,7 +533,7 @@ class ImageField(FileField): url_re = re.compile( r'^https?://' # http:// or https:// - r'(?:(?:[A-Z0-9-]+\.)+[A-Z]{2,6}|' #domain... + r'(?:(?:[A-Z0-9]+(?:-*[A-Z0-9]+)*\.)+[A-Z]{2,6}|' #domain... r'localhost|' #localhost... r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip r'(?::\d+)?' # optional port -- cgit v1.3