-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
& in the title becomes & after sending #315
Comments
Seems more likely that Django is escaping |
Ah, but the strang thing is that I did not use a template. I was using a title (email subject) saved to the database, not a template. |
I would need to dig more, but I seem to recall the subject is rendered as a template, so the ampersand will still be escaped automatically by Django. You could override this template snippet to flag the content as Whether this should be updated in the package is probably a call for the maintainers. |
I can confirm that if you do the overriding as suggested by @studybuffalo of that simple template like this: Question to the maintainer @dokterbob: would it be a risk to hard code it in the original template? |
Similarly to the discussion on the escaping of recipient names here, email headers do need their proper encoding, or else there remains the possibility of header injection attacks (and other erroneous or unexpected behaviour). The question is, whether Django already properly encodes subject headers, in which case, in deed, we can consider the template as safe. To which, the answer is: YES! As opposed to adding Ref: https://django.readthedocs.io/en/stable/ref/templates/language.html#for-template-blocks |
From your linked doc To your safe block suggestion: have you got some arguments why a block shall be used over the |
I think the title is descriptive enough. I have send a newsletter with
&
in the title and it became&
in everyone's mailbox. It seems unicode is not supported?The text was updated successfully, but these errors were encountered: