Opened 15 years ago

Closed 15 years ago

Last modified 13 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: dev
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: no UI/UX: no

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 15 years ago.
Updated patch against trunk with test included
EmailField_single_letter_domains.diff (896 bytes ) - added by Daniel Gonzalez Gasull 15 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Gumnos, 15 years ago

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

comment:2 by Gumnos, 15 years ago

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.

by Gumnos, 15 years ago

Attachment: email.patch added

Updated patch against trunk with test included

comment:3 by Russell Keith-Magee, 15 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:4 by Daniel Gonzalez Gasull, 15 years ago

Owner: changed from nobody to Daniel Gonzalez Gasull

by Daniel Gonzalez Gasull, 15 years ago

comment:5 by Daniel Gonzalez Gasull, 15 years ago

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 by Jason Yosinski, 15 years ago

Cc: Jason Yosinski added

comment:7 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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