summaryrefslogtreecommitdiff
path: root/django/forms/fields.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-04-16 14:25:18 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-04-16 14:25:18 +0000
commit6590061a005b8772baee1a94d7799bcb58d9841d (patch)
treef3a151c7ebf4a814aab5f68a0028787a658ce79e /django/forms/fields.py
parent48b459a83e40aa6dae588f114d68f54b95e860de (diff)
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
Diffstat (limited to 'django/forms/fields.py')
-rw-r--r--django/forms/fields.py2
1 files changed, 1 insertions, 1 deletions
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