mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #11144 -- When a to/from/cc header contains unicode, make sure the email addresses are parsed correctly (especially with regards to commas). Thanks to rmt for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11719 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -101,6 +101,17 @@ BadHeaderError: Header values can't contain newlines (got u'Subject\nInjection T
|
||||
>>> message['From']
|
||||
'from@example.com'
|
||||
|
||||
# Regression for #11144 - When a to/from/cc header contains unicode,
|
||||
# make sure the email addresses are parsed correctly (especially
|
||||
# with regards to commas)
|
||||
>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['"Firstname Sürname" <to@example.com>','other@example.com'])
|
||||
>>> email.message()['To']
|
||||
'=?utf-8?q?Firstname_S=C3=BCrname?= <to@example.com>, other@example.com'
|
||||
|
||||
>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['"Sürname, Firstname" <to@example.com>','other@example.com'])
|
||||
>>> email.message()['To']
|
||||
'=?utf-8?q?S=C3=BCrname=2C_Firstname?= <to@example.com>, other@example.com'
|
||||
|
||||
# Handle attachments within an multipart/alternative mail correctly (#9367)
|
||||
# (test is not as precise/clear as it could be w.r.t. email tree structure,
|
||||
# but it's good enough.)
|
||||
|
||||
Reference in New Issue
Block a user