From a09aa0d793818dc4cae78ac4bcfb557d4fd2a30d Mon Sep 17 00:00:00 2001 From: Remigijus Kiminas Date: Mon, 4 Apr 2022 23:40:53 -0400 Subject: [PATCH] Add missing applicaiton/json header where missing --- lhc_web/modules/lhcannedmsg/showsuggester.php | 2 ++ lhc_web/modules/lhcannedmsg/subject.php | 1 + lhc_web/modules/lhchat/blockuser.php | 2 ++ lhc_web/modules/lhchat/changestatus.php | 6 +++++- lhc_web/modules/lhchat/checkchatstatus.php | 2 ++ lhc_web/modules/lhchat/editprevious.php | 4 +++- lhc_web/modules/lhchat/getmessageadmin.php | 2 ++ lhc_web/modules/lhchat/holdaction.php | 2 ++ lhc_web/modules/lhcobrowse/checkinitializer.php | 3 ++- lhc_web/modules/lhcobrowse/checkmirrorchanges.php | 2 ++ lhc_web/modules/lhuser/setinactive.php | 1 + lhc_web/modules/lhxml/accepttransfer.php | 3 +++ lhc_web/modules/lhxml/accepttransferbychat.php | 2 ++ lhc_web/modules/lhxml/chatdata.php | 3 +++ lhc_web/modules/lhxml/chatssynchro.php | 2 ++ lhc_web/modules/lhxml/checklogin.php | 2 ++ lhc_web/modules/lhxml/getuseronlinestatus.php | 2 ++ lhc_web/modules/lhxml/transferchat.php | 2 ++ lhc_web/modules/lhxml/userinfo.php | 2 ++ 19 files changed, 42 insertions(+), 3 deletions(-) diff --git a/lhc_web/modules/lhcannedmsg/showsuggester.php b/lhc_web/modules/lhcannedmsg/showsuggester.php index 3032a23576..88ad17c0f7 100644 --- a/lhc_web/modules/lhcannedmsg/showsuggester.php +++ b/lhc_web/modules/lhcannedmsg/showsuggester.php @@ -1,5 +1,7 @@ load( 'erLhcoreClassModelChat', $Params['user_parameters']['chat_id']); diff --git a/lhc_web/modules/lhcannedmsg/subject.php b/lhc_web/modules/lhcannedmsg/subject.php index 6c02e796c6..39e1b6e8c1 100644 --- a/lhc_web/modules/lhcannedmsg/subject.php +++ b/lhc_web/modules/lhcannedmsg/subject.php @@ -42,6 +42,7 @@ } $db->commit(); + header('Content-type: application/json'); echo json_encode($response); exit; } diff --git a/lhc_web/modules/lhchat/blockuser.php b/lhc_web/modules/lhchat/blockuser.php index 684f31852d..17ef10587f 100644 --- a/lhc_web/modules/lhchat/blockuser.php +++ b/lhc_web/modules/lhchat/blockuser.php @@ -85,10 +85,12 @@ erLhcoreClassModelChatBlockedUser::blockChat($params); $tpl = erLhcoreClassTemplate::getInstance('lhkernel/alert_success.tpl.php'); $tpl->set('msg', erTranslationClassLhTranslation::getInstance()->getTranslation('chat/blockedusers', 'Visitor was blocked!')); + header('Content-type: application/json'); echo json_encode(array('error' => false, 'result' => $tpl->fetch())); } else { $tpl = erLhcoreClassTemplate::getInstance('lhkernel/validation_error.tpl.php'); $tpl->set('errors', $Errors); + header('Content-type: application/json'); echo json_encode(array('error' => true, 'result' => $tpl->fetch())); } diff --git a/lhc_web/modules/lhchat/changestatus.php b/lhc_web/modules/lhchat/changestatus.php index 60682e30f0..ea924895f5 100644 --- a/lhc_web/modules/lhchat/changestatus.php +++ b/lhc_web/modules/lhchat/changestatus.php @@ -13,6 +13,7 @@ $changeStatus = (int) $_POST['ChatStatus']; if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) { + header('Content-type: application/json'); echo json_encode(array( 'error' => 'true', 'result' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Invalid CSRF token!') @@ -37,13 +38,16 @@ )); erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.data_changed',array('chat' => & $chat, 'user' => $currentUser)); - + + header('Content-type: application/json'); echo json_encode(array( 'error' => 'false', 'is_owner' => $chat->user_id == $userData->id )); exit(); } else { + + header('Content-type: application/json'); echo json_encode(array( 'error' => 'true', 'result' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Invalid chat status') diff --git a/lhc_web/modules/lhchat/checkchatstatus.php b/lhc_web/modules/lhchat/checkchatstatus.php index 3f48691ef0..cc49a75c2f 100644 --- a/lhc_web/modules/lhchat/checkchatstatus.php +++ b/lhc_web/modules/lhchat/checkchatstatus.php @@ -1,5 +1,7 @@ load( 'erLhcoreClassModelChat', $Params['user_parameters']['chat_id']); diff --git a/lhc_web/modules/lhchat/getmessageadmin.php b/lhc_web/modules/lhchat/getmessageadmin.php index 1f2a6f9fc4..b35250f37f 100644 --- a/lhc_web/modules/lhchat/getmessageadmin.php +++ b/lhc_web/modules/lhchat/getmessageadmin.php @@ -1,5 +1,7 @@ load ( 'erLhcoreClassModelChat', $Params ['user_parameters'] ['chat_id'] ); diff --git a/lhc_web/modules/lhchat/holdaction.php b/lhc_web/modules/lhchat/holdaction.php index f341c5e0ce..b9ca5477e2 100644 --- a/lhc_web/modules/lhchat/holdaction.php +++ b/lhc_web/modules/lhchat/holdaction.php @@ -1,5 +1,7 @@ beginTransaction(); diff --git a/lhc_web/modules/lhcobrowse/checkinitializer.php b/lhc_web/modules/lhcobrowse/checkinitializer.php index 20f9248af3..0078e054c0 100644 --- a/lhc_web/modules/lhcobrowse/checkinitializer.php +++ b/lhc_web/modules/lhcobrowse/checkinitializer.php @@ -1,4 +1,5 @@ -getUserData(true); diff --git a/lhc_web/modules/lhxml/accepttransfer.php b/lhc_web/modules/lhxml/accepttransfer.php index b87ac6d4b2..d5653fb6c2 100644 --- a/lhc_web/modules/lhxml/accepttransfer.php +++ b/lhc_web/modules/lhxml/accepttransfer.php @@ -1,4 +1,7 @@ isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password'])) { diff --git a/lhc_web/modules/lhxml/accepttransferbychat.php b/lhc_web/modules/lhxml/accepttransferbychat.php index ef3e87dcbe..6578254f09 100644 --- a/lhc_web/modules/lhxml/accepttransferbychat.php +++ b/lhc_web/modules/lhxml/accepttransferbychat.php @@ -1,5 +1,7 @@ isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password'])) { diff --git a/lhc_web/modules/lhxml/chatdata.php b/lhc_web/modules/lhxml/chatdata.php index 7f191c5d7d..df0e81bd94 100644 --- a/lhc_web/modules/lhxml/chatdata.php +++ b/lhc_web/modules/lhxml/chatdata.php @@ -1,4 +1,7 @@ isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password'])) { diff --git a/lhc_web/modules/lhxml/chatssynchro.php b/lhc_web/modules/lhxml/chatssynchro.php index 346996efb2..da59ccd1b3 100644 --- a/lhc_web/modules/lhxml/chatssynchro.php +++ b/lhc_web/modules/lhxml/chatssynchro.php @@ -1,5 +1,7 @@ isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password'])) { diff --git a/lhc_web/modules/lhxml/checklogin.php b/lhc_web/modules/lhxml/checklogin.php index 2e776e0858..a5bc042e63 100644 --- a/lhc_web/modules/lhxml/checklogin.php +++ b/lhc_web/modules/lhxml/checklogin.php @@ -3,6 +3,8 @@ // Debug //erLhcoreClassLog::write(print_r($_POST,true)); +header('Content-type: application/json'); + @ini_set('session.cookie_samesite', 'None'); @ini_set('session.cookie_secure', true); diff --git a/lhc_web/modules/lhxml/getuseronlinestatus.php b/lhc_web/modules/lhxml/getuseronlinestatus.php index 422d4dcf84..25ab3775a9 100644 --- a/lhc_web/modules/lhxml/getuseronlinestatus.php +++ b/lhc_web/modules/lhxml/getuseronlinestatus.php @@ -1,4 +1,6 @@ isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password'])) { diff --git a/lhc_web/modules/lhxml/transferchat.php b/lhc_web/modules/lhxml/transferchat.php index 68c1a78de9..c0cce06969 100644 --- a/lhc_web/modules/lhxml/transferchat.php +++ b/lhc_web/modules/lhxml/transferchat.php @@ -1,5 +1,7 @@ isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password'])) { diff --git a/lhc_web/modules/lhxml/userinfo.php b/lhc_web/modules/lhxml/userinfo.php index e7fcae3c47..779cbe4990 100644 --- a/lhc_web/modules/lhxml/userinfo.php +++ b/lhc_web/modules/lhxml/userinfo.php @@ -1,5 +1,7 @@