diff --git a/bug_report.php b/bug_report.php index e0395b6..6e9e8b5 100644 --- a/bug_report.php +++ b/bug_report.php @@ -23,10 +23,9 @@ if(addslashes(strip_tags($_POST['form_address'])) != "" AND addslashes(strip_tags($_POST['form_name'])) != "" AND addslashes(strip_tags($_POST['form_message'])) != "") { $email = addslashes(strip_tags($_POST['form_address'])); + $email = filter_var($email, FILTER_SANITIZE_EMAIL); - $check = '/^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/'; - - if(preg_match($check, $email)) + if (filter_var($email, FILTER_VALIDATE_EMAIL)) { if($_SESSION['captcha'] != addslashes(strip_tags($_POST['user_code']))) { @@ -39,7 +38,7 @@ - Submitter's address: ".addslashes(strip_tags($_POST['form_address']))."
+ Submitter's address: ".$email."
Submitter's name: ".addslashes(strip_tags($_POST['form_name']))."
IP: ".addslashes(strip_tags($_POST['ip']))."
Problem with: ".addslashes(strip_tags($_POST['form_case']))."
@@ -49,7 +48,7 @@ "; $subject="Bug report from Twittodon.com ".date('d-m-Y H:i'); $header = "MIME-Version: 1.0r\n"."Content-type: text/html; charset=utf-8\n"; - $header .= "From: ".addslashes(strip_tags($_POST['form_address']))."\n"; + $header .= "From: ".$email."\n"; $address = "support@twittodon.com"; mail($address, $subject, $message, $header); @@ -344,4 +343,4 @@ - \ No newline at end of file +