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
24003295
Kaydet (Commit)
24003295
authored
Nis 14, 2015
tarafından
Anoop Thomas Mathew
Kaydeden (comit)
Tim Graham
Nis 17, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #24349 -- Limited domain name labels to 63 characters in EmailValidator
üst
b98dfc21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
validators.py
django/core/validators.py
+2
-3
1.9.txt
docs/releases/1.9.txt
+3
-0
tests.py
tests/validators/tests.py
+8
-3
No files found.
django/core/validators.py
Dosyayı görüntüle @
24003295
...
@@ -142,9 +142,8 @@ class EmailValidator(object):
...
@@ -142,9 +142,8 @@ class EmailValidator(object):
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)'
,
# quoted-string
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)'
,
# quoted-string
re
.
IGNORECASE
)
re
.
IGNORECASE
)
domain_regex
=
re
.
compile
(
domain_regex
=
re
.
compile
(
# max length of the domain is 249: 254 (max email length) minus one
# max length for domain name labels is 63 characters per RFC 1034
# period, two characters for the TLD, @ sign, & one character before @.
r'((?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+)(?:[A-Z0-9-]{2,63}(?<!-))$'
,
r'(?:[A-Z0-9](?:[A-Z0-9-]{0,247}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}(?<!-))$'
,
re
.
IGNORECASE
)
re
.
IGNORECASE
)
literal_regex
=
re
.
compile
(
literal_regex
=
re
.
compile
(
# literal form, ipv4 or ipv6 address (SMTP 4.1.3)
# literal form, ipv4 or ipv6 address (SMTP 4.1.3)
...
...
docs/releases/1.9.txt
Dosyayı görüntüle @
24003295
...
@@ -242,6 +242,9 @@ Validators
...
@@ -242,6 +242,9 @@ Validators
* Added :func:`django.core.validators.int_list_validator` to generate
* Added :func:`django.core.validators.int_list_validator` to generate
validators of strings containing integers separated with a custom character.
validators of strings containing integers separated with a custom character.
* :class:`~django.core.validators.EmailValidator` now limits the length of
domain name labels to 63 characters per :rfc:`1034`.
Backwards incompatible changes in 1.9
Backwards incompatible changes in 1.9
=====================================
=====================================
...
...
tests/validators/tests.py
Dosyayı görüntüle @
24003295
...
@@ -45,7 +45,12 @@ TEST_DATA = [
...
@@ -45,7 +45,12 @@ TEST_DATA = [
(
validate_email
,
'email@localhost'
,
None
),
(
validate_email
,
'email@localhost'
,
None
),
(
EmailValidator
(
whitelist
=
[
'localdomain'
]),
'email@localdomain'
,
None
),
(
EmailValidator
(
whitelist
=
[
'localdomain'
]),
'email@localdomain'
,
None
),
(
validate_email
,
'"test@test"@example.com'
,
None
),
(
validate_email
,
'"test@test"@example.com'
,
None
),
(
validate_email
,
'example@atm.
%
s'
%
(
'a'
*
63
),
None
),
(
validate_email
,
'example@
%
s.atm'
%
(
'a'
*
63
),
None
),
(
validate_email
,
'example@
%
s.
%
s.atm'
%
(
'a'
*
63
,
'b'
*
10
),
None
),
(
validate_email
,
'example@atm.
%
s'
%
(
'a'
*
64
),
ValidationError
),
(
validate_email
,
'example@
%
s.atm.
%
s'
%
(
'b'
*
64
,
'a'
*
63
),
ValidationError
),
(
validate_email
,
None
,
ValidationError
),
(
validate_email
,
None
,
ValidationError
),
(
validate_email
,
''
,
ValidationError
),
(
validate_email
,
''
,
ValidationError
),
(
validate_email
,
'abc'
,
ValidationError
),
(
validate_email
,
'abc'
,
ValidationError
),
...
@@ -69,9 +74,9 @@ TEST_DATA = [
...
@@ -69,9 +74,9 @@ TEST_DATA = [
(
validate_email
,
'"
\\\011
"@here.com'
,
None
),
(
validate_email
,
'"
\\\011
"@here.com'
,
None
),
(
validate_email
,
'"
\\\012
"@here.com'
,
ValidationError
),
(
validate_email
,
'"
\\\012
"@here.com'
,
ValidationError
),
(
validate_email
,
'trailingdot@shouldfail.com.'
,
ValidationError
),
(
validate_email
,
'trailingdot@shouldfail.com.'
,
ValidationError
),
# Max length of domain name
in email is 249 (see validator for calculation)
# Max length of domain name
labels is 63 characters per RFC 1034.
(
validate_email
,
'a@
%
s.us'
%
(
'a'
*
249
),
None
),
(
validate_email
,
'a@
%
s.us'
%
(
'a'
*
63
),
None
),
(
validate_email
,
'a@
%
s.us'
%
(
'a'
*
250
),
ValidationError
),
(
validate_email
,
'a@
%
s.us'
%
(
'a'
*
64
),
ValidationError
),
(
validate_slug
,
'slug-ok'
,
None
),
(
validate_slug
,
'slug-ok'
,
None
),
(
validate_slug
,
'longer-slug-still-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