From a954f506e0bf23798d7fee41a07dcba2c80c915d Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 26 Jan 2021 00:05:30 +0100 Subject: [PATCH] widget/contact: send from given name Apply naam input to sender email address. --- widget/contact.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/widget/contact.php b/widget/contact.php index a4fccda..c6e7022 100644 --- a/widget/contact.php +++ b/widget/contact.php @@ -52,6 +52,9 @@ switch ($source) { $reply = preg_match('/\A[^\s\'@]{1,64}@[.a-zA-Z0-9-]{4,63}\z/', @$input['email']) ? $input['email'] : "noreply@$domain"; + if ($displayname = @$input['naam']) { + $reply = sprintf('"%s" <%s>', addcslashes($displayname, "\\\"\0..\37"), $reply); + } $header = "From: $reply"; foreach (array( -- 2.30.0