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
1f8bb95c
Kaydet (Commit)
1f8bb95c
authored
Tem 05, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Corrected domain max length for EmailValidator; refs #20631.
Thanks MarkusH for the report.
üst
7fd55c34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
validators.py
django/core/validators.py
+3
-3
tests.py
tests/validators/tests.py
+3
-3
No files found.
django/core/validators.py
Dosyayı görüntüle @
1f8bb95c
...
...
@@ -124,9 +124,9 @@ class EmailValidator(object):
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)'
,
# quoted-string
re
.
IGNORECASE
)
domain_regex
=
re
.
compile
(
# max length of the domain is 2
51
: 254 (max email length) minus one
# period
and two characters for the TLD
.
r'(?:[A-Z0-9](?:[A-Z0-9-]{0,24
9
}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}(?<!-))$'
,
# max length of the domain is 2
49
: 254 (max email length) minus one
# period
, two characters for the TLD, @ sign, & one character before @
.
r'(?:[A-Z0-9](?:[A-Z0-9-]{0,24
7
}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}(?<!-))$'
,
re
.
IGNORECASE
)
literal_regex
=
re
.
compile
(
# literal form, ipv4 or ipv6 address (SMTP 4.1.3)
...
...
tests/validators/tests.py
Dosyayı görüntüle @
1f8bb95c
...
...
@@ -66,9 +66,9 @@ TEST_DATA = (
(
validate_email
,
'"
\\\011
"@here.com'
,
None
),
(
validate_email
,
'"
\\\012
"@here.com'
,
ValidationError
),
(
validate_email
,
'trailingdot@shouldfail.com.'
,
ValidationError
),
# Max length of domain name in email is 2
51
(see validator for calculation)
(
validate_email
,
'a@
%
s.
com'
%
(
'a'
*
251
),
None
),
(
validate_email
,
'a@
%
s.
com'
%
(
'a'
*
252
),
ValidationError
),
# Max length of domain name in email is 2
49
(see validator for calculation)
(
validate_email
,
'a@
%
s.
us'
%
(
'a'
*
249
),
None
),
(
validate_email
,
'a@
%
s.
us'
%
(
'a'
*
250
),
ValidationError
),
(
validate_slug
,
'slug-ok'
,
None
),
(
validate_slug
,
'longer-slug-still-ok'
,
None
),
...
...
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