summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-02-12 19:11:49 +0000
committerJannis Leidel <jannis@leidel.info>2011-02-12 19:11:49 +0000
commit47b1a8e704b375f0b4f79db8432e4373d33e746d (patch)
tree30ca6598298914afbc2325102f1d4b50906c6605 /django
parentff4a24af515a5fa36f522d96e9491de0194b8bed (diff)
Fixed #12988 -- Extended regular expression of the URLValidator to fully support IDN-URLs, especially the long TLDs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/core/validators.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/validators.py b/django/core/validators.py
index 7562330dcd..233c0886ac 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -46,7 +46,7 @@ class HeadRequest(urllib2.Request):
class URLValidator(RegexValidator):
regex = re.compile(
r'^https?://' # http:// or https://
- r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?|' #domain...
+ r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
r'localhost|' #localhost...
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
r'(?::\d+)?' # optional port