Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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: UI/UX:


The header injection example code in 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.

Change History (1)

comment:1 Changed 12 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [1798]) Fixed #1139 -- Changed django.core.mail to raise BadHeaderError (a subclass of ValueError) and changed docs/email.txt example to use that

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