Code

Opened 5 years ago

Closed 4 years ago

Last modified 3 years ago

#12005 closed (invalid)

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

Reported by: Gumnos Owned by: djansoft
Component: Forms Version: master
Severity: Keywords: email_re subdomain speed single letter
Cc: JasonYosinski 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 5 years ago.
Updated patch against trunk with test included
EmailField_single_letter_domains.diff (896 bytes) - added by djansoft 4 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 5 years ago by Gumnos

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 5 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 5 years ago by Gumnos

Updated patch against trunk with test included

comment:3 Changed 4 years ago by russellm

  • milestone set to 1.2
  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 4 years ago by djansoft

  • Owner changed from nobody to djansoft

Changed 4 years ago by djansoft

comment:5 Changed 4 years ago by djansoft

  • Resolution set to invalid
  • Status changed from new to closed

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 4 years ago by JasonYosinski

  • Cc JasonYosinski added

comment:7 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.