Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
b1afebf8
Kaydet (Commit)
b1afebf8
authored
Şub 11, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #26204 -- Reallowed dashes in top-level domains for URLValidator.
Thanks Shai Berger for the review.
üst
d58aaa24
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
2 deletions
+21
-2
validators.py
django/core/validators.py
+8
-1
1.8.10.txt
docs/releases/1.8.10.txt
+3
-0
1.9.3.txt
docs/releases/1.9.3.txt
+3
-0
invalid_urls.txt
tests/validators/invalid_urls.txt
+3
-1
valid_urls.txt
tests/validators/valid_urls.txt
+4
-0
No files found.
django/core/validators.py
Dosyayı görüntüle @
b1afebf8
...
...
@@ -86,7 +86,14 @@ class URLValidator(RegexValidator):
hostname_re
=
r'[a-z'
+
ul
+
r'0-9](?:[a-z'
+
ul
+
r'0-9-]{0,61}[a-z'
+
ul
+
r'0-9])?'
# Max length for domain name labels is 63 characters per RFC 1034 sec. 3.1
domain_re
=
r'(?:\.(?!-)[a-z'
+
ul
+
r'0-9-]{1,63}(?<!-))*'
tld_re
=
r'\.(?:[a-z'
+
ul
+
r']{2,63}|xn--[a-z0-9]{1,59})\.?'
tld_re
=
(
'
\
.'
# dot
'(?!-)'
# can't start with a dash
'(?:[a-z'
+
ul
+
'-]{2,63}'
# domain label
'|xn--[a-z0-9]{1,59})'
# or punycode label
'(?<!-)'
# can't end with a dash
'
\
.?'
# may have a trailing dot
)
host_re
=
'('
+
hostname_re
+
domain_re
+
tld_re
+
'|localhost)'
regex
=
_lazy_re_compile
(
...
...
docs/releases/1.8.10.txt
Dosyayı görüntüle @
b1afebf8
...
...
@@ -21,3 +21,6 @@ Bugfixes
* Fixed :class:`~django.contrib.postgres.fields.RangeField` and
:class:`~django.contrib.postgres.fields.ArrayField` serialization with
``None`` values (:ticket:`26215`).
* Reallowed dashes in top-level domain names of URLs checked by
``URLValidator`` to fix a regression in Django 1.8 (:ticket:`26204`).
docs/releases/1.9.3.txt
Dosyayı görüntüle @
b1afebf8
...
...
@@ -34,3 +34,6 @@ Bugfixes
* Fixed a crash when filtering by a ``Decimal`` in ``RawQuery``
(:ticket:`26219`).
* Reallowed dashes in top-level domain names of URLs checked by
``URLValidator`` to fix a regression in Django 1.8 (:ticket:`26204`).
tests/validators/invalid_urls.txt
Dosyayı görüntüle @
b1afebf8
...
...
@@ -6,7 +6,7 @@ http://.com
http://invalid-.com
http://-invalid.com
http://invalid.com-
http://invalid.
c-
m
http://invalid.
-co
m
http://inv-.alid-.com
http://inv-.-alid.com
file://localhost/path
...
...
@@ -33,6 +33,8 @@ http:// shouldfail.com
:// should fail
http://foo.bar/foo(bar)baz quux
http://-error-.invalid/
http://dashinpunytld.trailingdot.xn--.
http://dashinpunytld.xn---
http://-a.b.co
http://a.b-.co
http://a.-b.co
...
...
tests/validators/valid_urls.txt
Dosyayı görüntüle @
b1afebf8
...
...
@@ -67,3 +67,7 @@ http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.example.c
http://example.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com
http://example.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaa
http://dashintld.c-m
http://multipledashintld.a-b-c
http://evenmoredashintld.a---c
http://dashinpunytld.xn---c
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment