From c1dae9205f7236b1d556dc3681133a121153a3ef Mon Sep 17 00:00:00 2001 From: Fraenkiman Date: Sat, 25 Feb 2023 19:49:14 +0100 Subject: [PATCH] for non-ASCII characters in the e-mail header fixes #209 Email notification is now sent when a new comment has been left and when the subject in the email header contains umlauts. --- comments.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comments.php b/comments.php index b461d07..9fb1653 100644 --- a/comments.php +++ b/comments.php @@ -222,7 +222,8 @@ function commentform() { $fp_config ['general'] ['title'] ), $lang ['comments'] ['mail']); - @utils_mail($from_mail, "{$lang ['comments'] ['newcomment']} {$lang ['comments'] ['newcomment']} {$fp_config['general']['title']}", $mail); + // for non-ASCII characters in the e-mail header, use RFC 1342 — Encodes data with MIME base64 + @utils_mail($from_mail, "=?utf-8?B?" . base64_encode($lang ['comments'] ['newcomment']) . "?= =?utf-8?B?" . base64_encode($fp_config ['general'] ['title']) . "?=", $mail); } // if comment is valid, this redirect will clean the postdata