X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/5ee0e5fcab7c55065de6603833ea6f5e86ac2d32..2573a637bff34caeb3de0f3489c0c6dfbf6d2a1d:/widget/contact.php diff --git a/widget/contact.php b/widget/contact.php index ed0a082..a4fccda 100644 --- a/widget/contact.php +++ b/widget/contact.php @@ -2,7 +2,7 @@ $error = NULL; if ($_POST) { global $User; - if ($User) { + if ($User->login) { $_REQUEST['login'] = $User->login; $_REQUEST['email'] = $_REQUEST['email'] ?: $User->email; } @@ -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"; @@ -58,7 +58,7 @@ switch ($source) { 'X-Accept-Language' => 'HTTP_ACCEPT_LANGUAGE', 'User-Agent' => 'HTTP_USER_AGENT', ) as $mailhdr => $serverhdr) { - if (!$_SERVER[$serverhdr]) continue; + if (empty($_SERVER[$serverhdr])) continue; $header .= "\r\n$mailhdr: ".$_SERVER[$serverhdr]; }