From 72c0df160bfe9838c618652facef29af99392ce3 Mon Sep 17 00:00:00 2001 From: Remigijus Kiminas Date: Wed, 30 Mar 2022 06:24:11 -0400 Subject: [PATCH] Type check --- lhc_web/modules/lhwidgetrestapi/addmsguser.php | 2 +- lhc_web/modules/lhwidgetrestapi/fetchmessage.php | 2 +- lhc_web/modules/lhwidgetrestapi/fetchmessages.php | 2 +- lhc_web/modules/lhwidgetrestapi/getmessagesnippet.php | 2 +- lhc_web/modules/lhwidgetrestapi/initchat.php | 2 +- lhc_web/modules/lhwidgetrestapi/sendmailsettings.php | 2 +- lhc_web/modules/lhwidgetrestapi/uisettings.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lhc_web/modules/lhwidgetrestapi/addmsguser.php b/lhc_web/modules/lhwidgetrestapi/addmsguser.php index f7e7114841..73f5bdeb37 100644 --- a/lhc_web/modules/lhwidgetrestapi/addmsguser.php +++ b/lhc_web/modules/lhwidgetrestapi/addmsguser.php @@ -29,7 +29,7 @@ erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.validstatus_chat',array('chat' => & $chat, 'valid_statuses' => & $validStatuses)); - if ($chat->hash == $payload['hash'] && (in_array($chat->status,$validStatuses)) && !in_array($chat->status_sub, array(erLhcoreClassModelChat::STATUS_SUB_SURVEY_COMPLETED, erLhcoreClassModelChat::STATUS_SUB_USER_CLOSED_CHAT, erLhcoreClassModelChat::STATUS_SUB_SURVEY_SHOW, erLhcoreClassModelChat::STATUS_SUB_CONTACT_FORM))) // Allow add messages only if chat is active + if ($chat->hash === $payload['hash'] && (in_array($chat->status,$validStatuses)) && !in_array($chat->status_sub, array(erLhcoreClassModelChat::STATUS_SUB_SURVEY_COMPLETED, erLhcoreClassModelChat::STATUS_SUB_USER_CLOSED_CHAT, erLhcoreClassModelChat::STATUS_SUB_SURVEY_SHOW, erLhcoreClassModelChat::STATUS_SUB_CONTACT_FORM))) // Allow add messages only if chat is active { $msgText = preg_replace('/\[html\](.*?)\[\/html\]/ms','',$payload['msg']); diff --git a/lhc_web/modules/lhwidgetrestapi/fetchmessage.php b/lhc_web/modules/lhwidgetrestapi/fetchmessage.php index 0d32f2714e..9d6b9b0385 100644 --- a/lhc_web/modules/lhwidgetrestapi/fetchmessage.php +++ b/lhc_web/modules/lhwidgetrestapi/fetchmessage.php @@ -16,7 +16,7 @@ $chat = erLhcoreClassModelChat::fetch($requestPayload['id']); - if ($chat instanceof erLhcoreClassModelChat && $chat->hash == $requestPayload['hash']) + if ($chat instanceof erLhcoreClassModelChat && $chat->hash === $requestPayload['hash']) { $msg = erLhcoreClassModelmsg::fetch($requestPayload['msg_id']); diff --git a/lhc_web/modules/lhwidgetrestapi/fetchmessages.php b/lhc_web/modules/lhwidgetrestapi/fetchmessages.php index 2e85d55ff6..0c1b2bb4e3 100644 --- a/lhc_web/modules/lhwidgetrestapi/fetchmessages.php +++ b/lhc_web/modules/lhwidgetrestapi/fetchmessages.php @@ -34,7 +34,7 @@ $responseArray = array('status' => erLhcoreClassModelChat::STATUS_CLOSED_CHAT, 'status_sub' => erLhcoreClassModelChat::STATUS_SUB_DEFAULT); -if (is_object($chat) && $chat->hash == $requestPayload['hash']) +if (is_object($chat) && $chat->hash === $requestPayload['hash']) { erLhcoreClassChat::setTimeZoneByChat($chat); $chat->updateIgnoreColumns = array('last_msg_id'); diff --git a/lhc_web/modules/lhwidgetrestapi/getmessagesnippet.php b/lhc_web/modules/lhwidgetrestapi/getmessagesnippet.php index 24a419ad43..6a439c71ab 100644 --- a/lhc_web/modules/lhwidgetrestapi/getmessagesnippet.php +++ b/lhc_web/modules/lhwidgetrestapi/getmessagesnippet.php @@ -16,7 +16,7 @@ $chat = erLhcoreClassModelChat::fetch($requestPayload['id']); - if ($chat instanceof erLhcoreClassModelChat && $chat->hash == $requestPayload['hash']) + if ($chat instanceof erLhcoreClassModelChat && $chat->hash === $requestPayload['hash']) { $msg = erLhcoreClassModelmsg::findOne(array('limit' => 1, 'sort' => 'id DESC', 'filtergt' => array('user_id' => 0), 'filter' => array('chat_id' => $chat->id))); diff --git a/lhc_web/modules/lhwidgetrestapi/initchat.php b/lhc_web/modules/lhwidgetrestapi/initchat.php index 8b97919a0b..0ad557dda6 100644 --- a/lhc_web/modules/lhwidgetrestapi/initchat.php +++ b/lhc_web/modules/lhwidgetrestapi/initchat.php @@ -29,7 +29,7 @@ erLhcoreClassChat::setTimeZoneByChat($chat); - if ($chat->hash == $requestPayload['hash']) + if ($chat->hash === $requestPayload['hash']) { // User online if ($chat->user_status != 0) { diff --git a/lhc_web/modules/lhwidgetrestapi/sendmailsettings.php b/lhc_web/modules/lhwidgetrestapi/sendmailsettings.php index d1fc435b9c..6b224bab61 100644 --- a/lhc_web/modules/lhwidgetrestapi/sendmailsettings.php +++ b/lhc_web/modules/lhwidgetrestapi/sendmailsettings.php @@ -6,7 +6,7 @@ $chat = erLhcoreClassModelChat::fetch($Params['user_parameters']['chat_id']); -if ($chat instanceof erLhcoreClassModelChat && $chat->hash == $Params['user_parameters']['hash']) +if ($chat instanceof erLhcoreClassModelChat && $chat->hash === $Params['user_parameters']['hash']) { if ($Params['user_parameters_unordered']['action'] == 'send') { diff --git a/lhc_web/modules/lhwidgetrestapi/uisettings.php b/lhc_web/modules/lhwidgetrestapi/uisettings.php index 7c2ab393a7..ecd763b95a 100644 --- a/lhc_web/modules/lhwidgetrestapi/uisettings.php +++ b/lhc_web/modules/lhwidgetrestapi/uisettings.php @@ -16,7 +16,7 @@ erLhcoreClassChat::setTimeZoneByChat($chat); - if ($chat->hash == $requestPayload['hash']) + if ($chat->hash === $requestPayload['hash']) { $outputResponse = array( 'operator' => 'operator',