Skip to content

Commit dfea27d

Browse files
authored
Fix. Common. Add bot detector state to ct_options. (#778)
1 parent e7963fa commit dfea27d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

inc/cleantalk-common.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,14 @@ function apbct_get_sender_info()
607607
$page_hits = RequestParameters::get('apbct_page_hits', Cookie::$force_alt_cookies_global);
608608
$page_hits = !empty($page_hits) ? TT::toString($page_hits) : null;
609609

610+
$ct_options = json_encode(
611+
array_merge(
612+
(array) $apbct->settings,
613+
['data__bot_detector_enabled' => apbct__is_bot_detector_enabled() ? 1 : 0]
614+
),
615+
JSON_UNESCAPED_SLASHES
616+
);
617+
610618
//Let's keep $data_array for debugging
611619
$data_array = array(
612620
'plugin_request_id' => $apbct->plugin_request_id,
@@ -615,7 +623,7 @@ function apbct_get_sender_info()
615623
'USER_AGENT' => Server::get('HTTP_USER_AGENT'),
616624
'page_url' => apbct_sender_info___get_page_url(),
617625
'cms_lang' => substr(get_locale(), 0, 2),
618-
'ct_options' => json_encode($apbct->settings, JSON_UNESCAPED_SLASHES),
626+
'ct_options' => $ct_options,
619627
'fields_number' => sizeof($_POST),
620628
'direct_post' => $cookie_is_ok === null && apbct_is_post() ? 1 : 0,
621629
// Raw data to validated JavaScript test in the cloud

0 commit comments

Comments
 (0)