Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#12005 closed (invalid)

django.forms.fields.email_re doesn't handle single-letter subdomains

Reported by: Gumnos Owned by: Daniel Gonzalez Gasull
Component: Forms Version: master
Severity: Keywords: email_re subdomain speed single letter
Cc: Jason Yosinski Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When domain-validating logic was moved from validators to forms.fields.email_re single-letter sub-domains are no longer caught. There were also some speed issues when processing longer email addresses that were resolved in 1.1.1 and 1.0.4 that this patch should also address in a similar manner. There may be a similar issue with forms.fields.url_re but I didn't get a chance to hack that too.

Attachments (2)

email.patch (1.9 KB) - added by Gumnos 7 years ago.
Updated patch against trunk with test included
EmailField_single_letter_domains.diff (896 bytes) - added by Daniel Gonzalez Gasull 7 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by Gumnos

This may conflict with r11603 but should resolve the same email_re issue there.

comment:2 Changed 7 years ago by Gumnos

It also looks like this may be a semi-regression. Tickets #1275 and #1288 regarding the same issue are closed as fixed in r2367 but that looks like it was before some (newforms?) refactor.

Changed 7 years ago by Gumnos

Attachment: email.patch added

Updated patch against trunk with test included

comment:3 Changed 7 years ago by Russell Keith-Magee

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:4 Changed 7 years ago by Daniel Gonzalez Gasull

Owner: changed from nobody to Daniel Gonzalez Gasull

Changed 7 years ago by Daniel Gonzalez Gasull

comment:5 Changed 7 years ago by Daniel Gonzalez Gasull

Resolution: invalid
Status: newclosed

It isn't clear if this ticket refers to 2nd level or 3rd level domains. Also, it isn't clear if with "caught" it means single-letter subdomains should be valid or rejected. In any case:

Single-letter 2nd level domains are valid:
http://en.wikipedia.org/wiki/Single-letter_second-level_domain#Active_single-letter_domains

Single-letter 3rd level domains are valid too: #1275

In both cases, Django forms is working as expected. Please see attached diff for tests.

comment:6 Changed 7 years ago by Jason Yosinski

Cc: Jason Yosinski added

comment:7 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top