From: Mischa POSLAWSKY Date: Mon, 25 Jan 2021 23:05:30 +0000 (+0100) Subject: widget/contact: send from given name X-Git-Tag: v5.2~10 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/a954f506e0bf23798d7fee41a07dcba2c80c915d widget/contact: send from given name Apply naam input to sender email address. --- 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(