From 274eba89c2cdb6c14e95811608af75fb430791b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Sep 2024 17:45:37 +0700 Subject: [PATCH] Fix. SendRequest. Excluding event_token from the request --- cleantalkantispam.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cleantalkantispam.php b/cleantalkantispam.php index 0bdc0f5..7ea8e2a 100644 --- a/cleantalkantispam.php +++ b/cleantalkantispam.php @@ -1123,12 +1123,19 @@ public function onAfterRoute() if( ! isset( $post_info['comment_type'] ) ) $post_info['comment_type'] = 'feedback_general_contact_form'; + if (is_string($message)) { + $message = json_decode($message, true); + } + if (isset($message['ct_bot_detector_event_token'])) { + unset($message['ct_bot_detector_event_token']); + } + $ctResponse = $this->ctSendRequest( 'check_message', array( 'sender_nickname' => $sender_nickname, 'sender_email' => $sender_email, - 'message' => $message, + 'message' => json_encode($message), 'post_info' => json_encode($post_info), ) );