diff options
| author | Dheerendra Rathor <dheeru.rathor14@gmail.com> | 2015-10-28 12:24:57 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-29 11:14:36 -0400 |
| commit | 540de2f7972c6aa68fbf36c6a0da137d768f2067 (patch) | |
| tree | 0f9755bb9fa1a2124cf419e837ba1ae9745b394f /django | |
| parent | 528ef71a760cc689dd2f7e81071865fcbfd77f8f (diff) | |
[1.8.x] Fixed #25620 -- Made URLValidator prohibit URLs with consecutive dots in the domain section.
Backport of 96fe90f5356971e0e51a0bc41e045dde600d7521 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/validators.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/validators.py b/django/core/validators.py index cd5b16b207..89d184f134 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -73,7 +73,7 @@ class URLValidator(RegexValidator): # Host patterns hostname_re = r'[a-z' + ul + r'0-9](?:[a-z' + ul + r'0-9-]*[a-z' + ul + r'0-9])?' - domain_re = r'(?:\.(?!-)[a-z' + ul + r'0-9-]*(?<!-))*' + domain_re = r'(?:\.(?!-)[a-z' + ul + r'0-9-]+(?<!-))*' tld_re = r'\.(?:[a-z' + ul + r']{2,}|xn--[a-z0-9]+)\.?' host_re = '(' + hostname_re + domain_re + tld_re + '|localhost)' |
