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 10:59:22 -0400 |
| commit | 96fe90f5356971e0e51a0bc41e045dde600d7521 (patch) | |
| tree | 2aea7447fc322179e3683ae1b59a83bd79adab78 /django | |
| parent | 15ef1dd478c5b6f005e5f782b7619f718ed55e84 (diff) | |
Fixed #25620 -- Made URLValidator prohibit URLs with consecutive dots in the domain section.
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 ee026f5e1d..69cc76ffab 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -84,7 +84,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)' |
