From: Mischa POSLAWSKY Date: Sun, 17 Nov 2019 13:51:08 +0000 (+0100) Subject: widget/contact: accept non-word characters in sender email addresses X-Git-Tag: v4.2~15 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/077d629ba58c7d23b90246d8c2773c282c23f59a widget/contact: accept non-word characters in sender email addresses Allow any remotely valid address, including . --- diff --git a/widget/contact.php b/widget/contact.php index ed0a082..6e04005 100644 --- a/widget/contact.php +++ b/widget/contact.php @@ -50,7 +50,7 @@ switch ($source) { } } - $reply = preg_match('/\A\w+@\w+\.[a-z]+\z/', @$input['email']) + $reply = preg_match('/\A[^\s\'@]{1,64}@[.a-zA-Z0-9-]{4,63}\z/', @$input['email']) ? $input['email'] : "noreply@$domain"; $header = "From: $reply";