#1139 closed defect (fixed)
Bug in email.txt documentation example code
Reported by: | Simon Willison | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The header injection example code in http://code.djangoproject.com/browser/django/trunk/docs/email.txt only checxs for '\n' in the headers, but Django itself checks for '\r' instead. Suggestion: instead of throwing a ValueError in the SafeMIMEText class throw a "BadHeaderError" (or similarly named) that is a subclass of ValueError. The example code can then try to send the email and show an error if it catches that exception.
Note:
See TracTickets
for help on using tickets.
(In [1798]) Fixed #1139 -- Changed django.core.mail to raise BadHeaderError (a subclass of ValueError) and changed docs/email.txt example to use that