X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/7213175b8391e8f47f54096fada4fdc33d82b8a1..6f67c60627918b9ef956914c63cb7290b7e2de13:/widget/contact.php diff --git a/widget/contact.php b/widget/contact.php index b505375..b7e073f 100644 --- a/widget/contact.php +++ b/widget/contact.php @@ -2,8 +2,12 @@ $error = NULL; if ($_POST) { global $User; - if ($User) { + if ($User->login) { $_REQUEST['login'] = $User->login; + $_REQUEST['email'] = $_REQUEST['email'] ?: $User->email; + } + else { + unset($_REQUEST['login']); } $error = mailform($_REQUEST); if (!empty($error)) { @@ -46,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";