#25452: Email validation for domain `gmail.-com` is considered valid
------------------------+------------------------------------
Reporter: phalt | Owner: bak1an
Type: Bug | Status: assigned
Component: Forms | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+------------------------------------
Changes (by bak1an):
* status: new => assigned
* owner: nobody => bak1an
Comment:
According to the https://tools.ietf.org/html/rfc1035 domain labels can
contain hyphens but not as their first character.
[https://github.com/django/django/blob/71ebcb85b931f43865df5b322b2cf06d3da23f69/django/core/validators.py#L160
EmailValidator.domain_regex] checks this for all labels but the last one
(the TLD) and it looks like a bug to me (not something that was done on
intention).
[https://github.com/django/django/blob/71ebcb85b931f43865df5b322b2cf06d3da23f69/django/core/validators.py#L89
URLValidator] uses more complex domain validation regex set (including
unicode, etc).
I will double check if borrowing those checks into {{{EmailValidator}}}
won't violate any standards and come back with a patch in case it's ok.
--
Ticket URL: <https://code.djangoproject.com/ticket/25452#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.1f8eedd1bc195fd95189bdb5f02dd7a6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.