Subject: [PATCH] Mod. Common. Do not set "ct_pointer_data" cookie if Bot Detector feature enabled. --- Index: cleantalk.module IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/cleantalk.module b/cleantalk.module --- a/cleantalk.module (revision 96aff075cbb5691e7f1df84ad4bc65e2b45641ff) +++ b/cleantalk.module (revision da2e25317a33389e85cf3078f5b03f6b984c318b) @@ -63,6 +63,10 @@ $use_alt_cookies = \Drupal::config('cleantalk.settings')->get('cleantalk_alternative_cookies_session') ? 1 : 0; $use_alt_cookies_marker = "var ct_use_alt_cookies = " . $use_alt_cookies . ";"; + // Use bot detector. + $use_bot_detector = \Drupal::config('cleantalk.settings')->get('cleantalk_bot_detector') ? 1 : 0; + $use_bot_detector_marker = "var ct_use_bot_detector = " . $use_bot_detector . ";"; + // Capture buffer set. $capture_buffer = \Drupal::config('cleantalk.settings')->get('cleantalk_check_external') && @@ -74,7 +78,12 @@ $page['#attached']['html_head'][] = [ [ '#tag' => 'script', - '#value' => $js_addon_body . $drupal_ac_antibot_js_body . $use_cookies_marker . $use_alt_cookies_marker . $capture_buffer_marker, + '#value' => $js_addon_body + . $drupal_ac_antibot_js_body + . $use_cookies_marker + . $use_alt_cookies_marker + . $capture_buffer_marker + . $use_bot_detector_marker, ], 'ga_scripts', ]; Index: js/apbct-public.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/js/apbct-public.js b/js/apbct-public.js --- a/js/apbct-public.js (revision 96aff075cbb5691e7f1df84ad4bc65e2b45641ff) +++ b/js/apbct-public.js (revision da2e25317a33389e85cf3078f5b03f6b984c318b) @@ -51,9 +51,15 @@ var ctMouseWriteDataInterval = setInterval( function () { - if(typeof ct_use_alt_cookies !== "undefined" && ct_use_alt_cookies === 1) { + /** + * Do not write mouse data if alternative sessions or bot detector is used. + */ + const altSessionsUsed = typeof ct_use_alt_cookies !== "undefined" && ct_use_alt_cookies === 1; + const botDetectorUsed = typeof ct_use_bot_detector !== "undefined" && ct_use_bot_detector === 1; + if( altSessionsUsed || botDetectorUsed ) { return; } + var ctMouseDataToSend = ctMouseData.slice(0,-1).concat("]"); ctSetCookie( [