From 5192aeb66f4cc01a6026251ce198eee5644b2291 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Fri, 28 Jun 2024 13:12:48 +0300 Subject: [PATCH] Strip \n and \r characters from email subjects to avoid crashes Fixes Sentry KIWI-TCMS-P7, https://kiwitcms.sentry.io/issues/5547586648/ --- tcms/core/history.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tcms/core/history.py b/tcms/core/history.py index 76a9fcccc2..484de0041a 100644 --- a/tcms/core/history.py +++ b/tcms/core/history.py @@ -54,6 +54,8 @@ def history_email_for(instance, title): "pk": instance.pk, "title": title, } + # no multi-line email headers + subject = subject.replace("\n", " ").replace("\r", " ") body = ( _(