Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22579 closed Bug (fixed)

validate_email accepts trailing dash

Reported by: jason@… Owned by: Sasha Romijn
Component: Core (Other) Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In django 1.6 an EmailField (validate_email) will accept an address with a trailing dash at the end. Example: 'foo@…-'
In django 1.4 it would trigger a ValidationError, so I believe this is a regression.

Tested like so:

>>> from django.core.validators import validate_email
>>> validate_email('foo@bar.com-')

expected: throws ValidationError
actual: no error thrown

This may be related to #12027, about the same behavior, but with a trailing dot. As with that bug, a trailing dash causes sendmail to throw an error.

Attachments (1)

22579-1.diff (2.3 KB ) - added by Claude Paroz 11 years ago.

Download all attachments as: .zip

Change History (7)

by Claude Paroz, 11 years ago

Attachment: 22579-1.diff added

comment:1 by Claude Paroz, 11 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 by Tomek Paczkowski, 11 years ago

Triage Stage: AcceptedReady for checkin

Tests are good, patch applies.

comment:3 by Sasha Romijn, 11 years ago

Owner: changed from nobody to Sasha Romijn
Status: newassigned

comment:4 by Erik Romijn <eromijn@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 424fe76349a2e34eafef13c2450a7a1f4d3115a6:

Fixed #22579 -- Corrected validation for email to reject trailing slash

Thanks to Claude Paroz for the report and patch and Tomasz
Paczkowski for the review.

comment:5 by Erik Romijn <eromijn@…>, 11 years ago

In 2a66d12e77821fbd4f2e4c3cb93eb9f84ca6f9ab:

[1.7.x] Fixed #22579 -- Corrected validation for email to reject trailing slash

Backport of 424fe76349a2e34eafef13c2450a7a1f4d3115a6 from master.

comment:6 by Erik Romijn <eromijn@…>, 11 years ago

In 50a289d05fba760716287d582c7ea19edd1159cc:

[1.6.x] Fixed #22579 -- Corrected validation for email to reject trailing slash

Backport of 424fe76349a2e34eafef13c2450a7a1f4d3115a6 from master.

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