Skip to content

Commit

Permalink
fix contact form checking
Browse files Browse the repository at this point in the history
  • Loading branch information
davydov committed Mar 28, 2019
1 parent fe47fc5 commit 3f085a5
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions cleantalk.antispam/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,28 +432,19 @@ public function OnPageStartHandler()
if ($ct_temp_msg_data === null)
CleantalkAntispam::CleantalkGetFields($_GET);

$sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
$sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
$subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
$contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
$message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());

if (is_array($message))
$message = implode("\n", $message);
$arUser = array();
$arUser["type"] = "feedback_general_contact_form";
$arUser["sender_ip"] = $_SERVER['REMOTE_ADDR'];
$arUser["sender_email"] = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
$arUser["sender_nickname"] = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
$arUser["message_title"] = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
$arUser["message_body"] = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());

if (is_array($arUser["message_body"]))
$arUser["message_body"] = implode("\n", $arUser["message_body"]);

if($sender_email!==null || $ct_global_without_email == 1)
{
$arUser = array();
$arUser["type"] = "feedback_general_contact_form";
$arUser["sender_email"] = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
$arUser["sender_nickname"] = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
$arUser["sender_ip"] = $_SERVER['REMOTE_ADDR'];
$arUser["message_title"] = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
$arUser["message_body"] = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : '');
$arUser["example_title"] = "";
$arUser["example_body"] = "";
$arUser["example_comments"] = "";

if($arUser["sender_email"] !== null || $ct_global_without_email == 1)
{
$aResult = CleantalkAntispam::CheckAllBefore($arUser,FALSE);

if(isset($aResult) && is_array($aResult))
Expand Down

0 comments on commit 3f085a5

Please sign in to comment.