Fix: handle hidden line breaks in email subjects when sending email (#13402)

This commit is contained in:
shamoon authored and GitHub committed 2026-07-29 14:35:30 +00:00
1 parent bbb9c86ba4
commit 5bd72014a6
2 files changed
+4 -1

No files matched your search

+3
View File
@@ -36,6 +36,9 @@ def send_email(
TODO: re-evaluate this pending https://code.djangoproject.com/ticket/35581 / https://github.com/django/django/pull/18966
"""
if "\r" in subject or "\n" in subject:
subject = " ".join(line.strip(" \t") for line in subject.splitlines())
email = EmailMessage(
subject=subject,
body=body,