Opened 19 years ago

Closed 19 years ago

Last modified 18 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: 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.

Change History (1)

comment:1 by Adrian Holovaty, 19 years ago

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