Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.182.2

Version Description

Aug 08 2022 =

Server variables sanitizing fixed, js key getting fixed, internal forms catching fixed.

  • Fix: removed & in getAndSanitize()
  • Fix: ct_add_hidden_fields() - the data in the locale storage is added in json format
  • Fix: Excluded wp-comments-post.php form from internal scripts
  • Fix. Server variables. ServerVariables::sanitizeDefault() method is abstract now.
  • Fix. Server variables. Common\Variables* classes are abstract now.
  • Fix. Server variables. Default sanitizing method implementation added to ApbctWP\Variables* classes.
  • Fix. Server variables. Client code fixed.
  • Fix: FluentForm integration fixed
  • Fix. Server variables. Url decoding removed.
Download this release

Release Info

Developer glomberg
Plugin Icon 128x128 Spam protection, AntiSpam, FireWall by CleanTalk
Version 5.182.2
Comparing to
See all releases

Code changes from version 5.182.1 to 5.182.2

cleantalk.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Anti-Spam by CleanTalk
5
  Plugin URI: https://cleantalk.org
6
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
7
- Version: 5.182.1
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
@@ -35,7 +35,7 @@ use Cleantalk\Common\Firewall;
35
  use Cleantalk\Common\Schema;
36
  use Cleantalk\ApbctWP\Variables\Get;
37
  use Cleantalk\ApbctWP\Variables\Post;
38
- use Cleantalk\Variables\Request;
39
  use Cleantalk\ApbctWP\Variables\Server;
40
 
41
  global $apbct, $wpdb, $pagenow;
4
  Plugin Name: Anti-Spam by CleanTalk
5
  Plugin URI: https://cleantalk.org
6
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
7
+ Version: 5.182.2
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
35
  use Cleantalk\Common\Schema;
36
  use Cleantalk\ApbctWP\Variables\Get;
37
  use Cleantalk\ApbctWP\Variables\Post;
38
+ use Cleantalk\ApbctWP\Variables\Request;
39
  use Cleantalk\ApbctWP\Variables\Server;
40
 
41
  global $apbct, $wpdb, $pagenow;
inc/cleantalk-public-integrations.php CHANGED
@@ -6,7 +6,7 @@ use Cleantalk\ApbctWP\State;
6
  use Cleantalk\ApbctWP\Variables\Cookie;
7
  use Cleantalk\ApbctWP\Variables\Get;
8
  use Cleantalk\ApbctWP\Variables\Post;
9
- use Cleantalk\Variables\Request;
10
  use Cleantalk\ApbctWP\Variables\Server;
11
 
12
  // MailChimp Premium for Wordpress
6
  use Cleantalk\ApbctWP\Variables\Cookie;
7
  use Cleantalk\ApbctWP\Variables\Get;
8
  use Cleantalk\ApbctWP\Variables\Post;
9
+ use Cleantalk\ApbctWP\Variables\Request;
10
  use Cleantalk\ApbctWP\Variables\Server;
11
 
12
  // MailChimp Premium for Wordpress
inc/cleantalk-public-validate.php CHANGED
@@ -154,6 +154,14 @@ function ct_contact_form_validate()
154
  }
155
 
156
  $ct_result = $base_call_result['ct_result'];
 
 
 
 
 
 
 
 
157
  if ( $ct_result->allow == 0 ) {
158
  // Recognize contact form an set it's name to $contact_form to use later
159
  $contact_form = null;
154
  }
155
 
156
  $ct_result = $base_call_result['ct_result'];
157
+
158
+ // Remove visible fields from POST
159
+ foreach ($_POST as $key => $_value) {
160
+ if (stripos($key, 'apbct_visible_fields') === 0) {
161
+ unset($_POST[$key]);
162
+ }
163
+ }
164
+
165
  if ( $ct_result->allow == 0 ) {
166
  // Recognize contact form an set it's name to $contact_form to use later
167
  $contact_form = null;
inc/cleantalk-public.php CHANGED
@@ -5,7 +5,7 @@ use Cleantalk\ApbctWP\Sanitize;
5
  use Cleantalk\ApbctWP\Variables\Cookie;
6
  use Cleantalk\ApbctWP\Variables\Get;
7
  use Cleantalk\ApbctWP\Variables\Post;
8
- use Cleantalk\Variables\Request;
9
  use Cleantalk\ApbctWP\Variables\Server;
10
 
11
  /**
@@ -592,7 +592,7 @@ function ct_add_hidden_fields(
592
  }
593
  apbct_attach_event_handler__backend(window, 'DOMContentLoaded', function(){
594
  if (typeof apbctLocalStorage === \"object\") {
595
- apbctLocalStorage.set('{$field_name}', '{$ct_checkjs_key}', false );
596
  } else {
597
  console.log('APBCT ERROR: apbctLocalStorage object is not loaded.');
598
  }
5
  use Cleantalk\ApbctWP\Variables\Cookie;
6
  use Cleantalk\ApbctWP\Variables\Get;
7
  use Cleantalk\ApbctWP\Variables\Post;
8
+ use Cleantalk\ApbctWP\Variables\Request;
9
  use Cleantalk\ApbctWP\Variables\Server;
10
 
11
  /**
592
  }
593
  apbct_attach_event_handler__backend(window, 'DOMContentLoaded', function(){
594
  if (typeof apbctLocalStorage === \"object\") {
595
+ apbctLocalStorage.set('{$field_name}', '{$ct_checkjs_key}', true );
596
  } else {
597
  console.log('APBCT ERROR: apbctLocalStorage object is not loaded.');
598
  }
js/apbct-public-bundle.min.js CHANGED
@@ -1 +1 @@
1
- function ctSetCookie(e,t,o){var n;("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",a="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+a}):"alternative"!==ctPublicFunctions.data__cookies_type||n||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})))}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(t,o,n){var a=o.callback||null,c=o.callback_context||null,i=o.callback_params||null,e=o.async||!0,l=o.notJson||null,r=o.timeout||15e3,n=n||null,s=o.button||null,d=o.spinner||null,u=o.progressbar||null,p=o.silent||null,m=o.no_nonce||null;"string"==typeof t?t=(t=m?t:t+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce)+"&no_cache="+Math.random():(m||(t._ajax_nonce=ctPublicFunctions._ajax_nonce),t.no_cache=Math.random()),s&&(s.setAttribute("disabled","disabled"),s.style.cursor="not-allowed"),d&&jQuery(d).css("display","inline"),jQuery.ajax({type:"POST",url:ctPublicFunctions._ajax_url,data:t,async:e,success:function(e){s&&(s.removeAttribute("disabled"),s.style.cursor="pointer"),d&&jQuery(d).css("display","none"),(e=l?e:JSON.parse(e)).error?(setTimeout(function(){u&&u.fadeOut("slow")},1e3),console.log("Error happens: "+(e.error||"Unkown"))):a&&(i?a.apply(c,[e,t,o,n].concat(i)):a(e,t,o,n))},error:function(e,t,o){s&&(s.removeAttribute("disabled"),s.style.cursor="pointer"),d&&jQuery(d).css("display","none"),o&&!p&&(console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin error: "+o+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))},timeout:r})}function apbct_public_sendREST(t,o){var n=o.callback||null,e=o.data||[],a=o.method||"POST";jQuery.ajax({type:a,url:ctPublicFunctions._rest_url+"cleantalk-antispam/v1/"+t,data:e,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",ctPublicFunctions._rest_nonce)},success:function(e){e.error?console.log("Error happens: "+(e.error||"Unknown")):n&&n(e,t,o,null)},error:function(e,t,o){o&&(console.log("APBCT_REST_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin REST API error: "+o+" Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))}})}apbctLocalStorage={get:function(e,t){void 0===t&&(t="value");e=localStorage.getItem(e);if(null!==e)try{const o=JSON.parse(e);return o.hasOwnProperty(t)?JSON.parse(o[t]):o}catch(e){return new Error(e)}return!1},set:function(e,t,o=!0){o?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)}};var ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(window,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(window,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&jQuery("body").append('<img alt="Cleantalk Pixel" id="apbct_pixel" style="display: none; left: 99999px;" src="'+e+'">')}function ctGetPixelUrl(){var e=ctGetPixelUrlLocalstorage();if(!1!==e){if(!ctIsOutdatedPixelUrlLocalstorage(e))return void ctSetPixelImg(e);ctCleaPixelUrlLocalstorage(e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(ctGetPixelUrlLocalstorage()||ctSetPixelUrlLocalstorage(e),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(ctGetPixelUrlLocalstorage()||ctSetPixelUrlLocalstorage(e),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function apbct_ready(){var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if("native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),jQuery("input[type = 'email'], #email").blur(checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=JSON.stringify(o),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);let a=document.querySelectorAll("[data-original-string]");if(a.length)for(let e=0;e<a.length;++e)a[e].parentElement.href||a[e].parentElement.parentElement.href||a[e].addEventListener("click",function e(t){this.removeEventListener("click",e),apbctAjaxEmailDecode(t)})}function apbctAjaxEmailDecode(t){const o=t.target;o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress","rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:{encodedEmail:t.target.dataset.originalString},method:"POST",callback:function(e){e.success&&(ctFillDecodedEmail(e.data,t.target),o.setAttribute("title",""),o.removeAttribute("style"))}}):apbct_public_sendAJAX({action:"apbct_decode_email",encodedEmail:t.target.dataset.originalString},{notJson:!0,callback:function(e){e.success&&(ctFillDecodedEmail(e.data,t.target),o.setAttribute("title",""),o.removeAttribute("style"))}})}function ctFillDecodedEmail(e,t){t.innerHTML=e}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,l=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===l.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(l.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var a=document.querySelectorAll("[name^=ct_checkjs]"),c=0;c<a.length;c++)a[c].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctSetPixelUrlLocalstorage(e){localStorage.setItem("session_pixel_url",e),localStorage.setItem(e,Math.floor(Date.now()/1e3).toString())}function ctGetPixelUrlLocalstorage(){var e=localStorage.getItem("session_pixel_url");return null!==e&&e}function ctIsOutdatedPixelUrlLocalstorage(e){e=Number(localStorage.getItem(e));return 10800<Math.floor(Date.now()/1e3).toString()-e}function ctCleaPixelUrlLocalstorage(e){localStorage.removeItem(e),localStorage.removeItem("session_pixel_url")}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;if("string"==typeof o.action)if(isIntegratedForm(o)){jQuery(o).before('<i class="cleantalk_placeholder" style="display: none;"></i>');var n=jQuery(o).prev(),a=o.outerHTML,c=jQuery(o).detach(),a=(n.after(a),document.createElement("input")),i=(a.name="action",a.value="cleantalk_force_ajax_check",a.type="hidden",document.forms[e]);i.appendChild(a);let t=!1;if(void 0!==i.classList){let e=["newsletterform","ml-block-form"];e.forEach(function(e){i.classList.contains(e)&&(t=e)})}if(t){let e=jQuery("form."+t).find('button[type="submit"]');void 0!==e&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(i,n,c)})}else document.forms[e].onsubmit=function(e){e.preventDefault();var t=jQuery(e.currentTarget).prev(),o=jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget,t,o)}}else-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((a=document.createElement("input")).name="cleantalk_hidden_action",a.value=o.action,a.type="hidden",o.appendChild(a),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var a=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(a.val())})})}function isIntegratedForm(e){var t=e.action;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com"))}function sendAjaxCheckingFormData(i,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(i),apbct_visible_fields_set_cookie(o),{}),o=i.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n,a,c){void 0!==e.apbct&&+e.apbct.blocked||(apbct_replace_inputs_values_from_other_form(jQuery(i).detach(),c),a.after(c),0===(e=jQuery(c).find("button[type=submit]")).length&&0===(e=jQuery(c).find("input[type=submit]")).length&&0===(e=jQuery(c).find('button[data-element="submit"]')).length&&0===(e=jQuery(c).find('input[type="image"][name="submit"]')).length||e[0].click())},callback_context:null,callback_params:[e,t]})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",jQuery.ajax({type:"POST",url:ctPublicFunctions._ajax_url,datatype:"text",data:o,success:function(e){if("true"!=e)return alert(e),!1;t.submit()},error:function(){t.submit()}})}function ct_check_internal__is_exclude_form(t){let e=[ctPublic.blog_home+"wp-login.php"];return e.some(e=>null!==t.match(new RegExp("^"+e)))}apbct_attach_event_handler(window,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(window,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(window,"scroll",ctSetHasScrolled),apbct_attach_event_handler(window,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){console.log(e.toString())}void 0!==n.apbct&&(n=n.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:n.comment}})),cleantalkModal.loaded=n.comment,cleantalkModal.open(),1==+n.stop_script&&window.stop())}}),cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},l=document.createElement("style"),i=(l.setAttribute("id","cleantalk-modal-styles"),l.innerHTML="body.cleantalk-modal-opened{"+i+"}",l.innerHTML+="#cleantalk-modal-overlay{"+t+"}",l.innerHTML+="#cleantalk-modal-close{"+n+"}",l.innerHTML+="#cleantalk-modal-close:before{"+a+"}",l.innerHTML+="#cleantalk-modal-close:after{"+c+"}",document.body.append(l),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),a=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?a.innerHTML=this.loaded:(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),jQuery(document).ready(function(){"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms&&ctPublicGDPR.gdpr_forms.forEach(function(e,t,o){var n=jQuery("#"+e+", ."+e);n.is("form")||(n.find("form")[0]?n=n.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?n=jQuery(".wpcf7[role=form]"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?n=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(n=jQuery(".wpforms-form"))),!n.is("form")&&"form"!==n.attr("role")||n.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required " style="display: inline; margin-right: 10px;">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>")})}),window.onload=function(){+ctPublic.settings__forms__check_external&&setTimeout(function(){ct_protect_external()},1500)},jQuery(document).ready(function(){let t="",o;if(+ctPublic.settings__forms__check_internal)for(let e=0;e<document.forms.length;e++)"string"==typeof document.forms[e].action&&(o=document.forms[e],null===(t=o.action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(ctPrevHandler=o.click,jQuery(o).off("**"),jQuery(o).off(),jQuery(o).on("submit",function(e){return ct_check_internal(e.target),!1})))});
1
+ function ctSetCookie(e,t,o){var n;("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",a="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+a}):"alternative"!==ctPublicFunctions.data__cookies_type||n||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})))}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(t,o,n){var a=o.callback||null,c=o.callback_context||null,i=o.callback_params||null,e=o.async||!0,l=o.notJson||null,r=o.timeout||15e3,n=n||null,s=o.button||null,d=o.spinner||null,u=o.progressbar||null,p=o.silent||null,m=o.no_nonce||null;"string"==typeof t?t=(t=m?t:t+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce)+"&no_cache="+Math.random():(m||(t._ajax_nonce=ctPublicFunctions._ajax_nonce),t.no_cache=Math.random()),s&&(s.setAttribute("disabled","disabled"),s.style.cursor="not-allowed"),d&&jQuery(d).css("display","inline"),jQuery.ajax({type:"POST",url:ctPublicFunctions._ajax_url,data:t,async:e,success:function(e){s&&(s.removeAttribute("disabled"),s.style.cursor="pointer"),d&&jQuery(d).css("display","none"),(e=l?e:JSON.parse(e)).error?(setTimeout(function(){u&&u.fadeOut("slow")},1e3),console.log("Error happens: "+(e.error||"Unkown"))):a&&(i?a.apply(c,[e,t,o,n].concat(i)):a(e,t,o,n))},error:function(e,t,o){s&&(s.removeAttribute("disabled"),s.style.cursor="pointer"),d&&jQuery(d).css("display","none"),o&&!p&&(console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin error: "+o+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))},timeout:r})}function apbct_public_sendREST(t,o){var n=o.callback||null,e=o.data||[],a=o.method||"POST";jQuery.ajax({type:a,url:ctPublicFunctions._rest_url+"cleantalk-antispam/v1/"+t,data:e,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",ctPublicFunctions._rest_nonce)},success:function(e){e.error?console.log("Error happens: "+(e.error||"Unknown")):n&&n(e,t,o,null)},error:function(e,t,o){o&&(console.log("APBCT_REST_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin REST API error: "+o+" Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))}})}apbctLocalStorage={get:function(e,t){void 0===t&&(t="value");e=localStorage.getItem(e);if(null!==e)try{const o=JSON.parse(e);return o.hasOwnProperty(t)?JSON.parse(o[t]):o}catch(e){return new Error(e)}return!1},set:function(e,t,o=!0){o?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)}};var ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(window,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(window,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&jQuery("body").append('<img alt="Cleantalk Pixel" id="apbct_pixel" style="display: none; left: 99999px;" src="'+e+'">')}function ctGetPixelUrl(){var e=ctGetPixelUrlLocalstorage();if(!1!==e){if(!ctIsOutdatedPixelUrlLocalstorage(e))return void ctSetPixelImg(e);ctCleaPixelUrlLocalstorage(e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(ctGetPixelUrlLocalstorage()||ctSetPixelUrlLocalstorage(e),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(ctGetPixelUrlLocalstorage()||ctSetPixelUrlLocalstorage(e),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function apbct_ready(){var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if("native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),jQuery("input[type = 'email'], #email").blur(checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=JSON.stringify(o),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);let a=document.querySelectorAll("[data-original-string]");if(a.length)for(let e=0;e<a.length;++e)a[e].parentElement.href||a[e].parentElement.parentElement.href||a[e].addEventListener("click",function e(t){this.removeEventListener("click",e),apbctAjaxEmailDecode(t)})}function apbctAjaxEmailDecode(t){const o=t.target;o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress","rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:{encodedEmail:t.target.dataset.originalString},method:"POST",callback:function(e){e.success&&(ctFillDecodedEmail(e.data,t.target),o.setAttribute("title",""),o.removeAttribute("style"))}}):apbct_public_sendAJAX({action:"apbct_decode_email",encodedEmail:t.target.dataset.originalString},{notJson:!0,callback:function(e){e.success&&(ctFillDecodedEmail(e.data,t.target),o.setAttribute("title",""),o.removeAttribute("style"))}})}function ctFillDecodedEmail(e,t){t.innerHTML=e}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,l=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===l.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(l.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var a=document.querySelectorAll("[name^=ct_checkjs]"),c=0;c<a.length;c++)a[c].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctSetPixelUrlLocalstorage(e){localStorage.setItem("session_pixel_url",e),localStorage.setItem(e,Math.floor(Date.now()/1e3).toString())}function ctGetPixelUrlLocalstorage(){var e=localStorage.getItem("session_pixel_url");return null!==e&&e}function ctIsOutdatedPixelUrlLocalstorage(e){e=Number(localStorage.getItem(e));return 10800<Math.floor(Date.now()/1e3).toString()-e}function ctCleaPixelUrlLocalstorage(e){localStorage.removeItem(e),localStorage.removeItem("session_pixel_url")}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;if("string"==typeof o.action)if(isIntegratedForm(o)){jQuery(o).before('<i class="cleantalk_placeholder" style="display: none;"></i>');var n=jQuery(o).prev(),a=o.outerHTML,c=jQuery(o).detach(),a=(n.after(a),document.createElement("input")),i=(a.name="action",a.value="cleantalk_force_ajax_check",a.type="hidden",document.forms[e]);i.appendChild(a);let t=!1;if(void 0!==i.classList){let e=["newsletterform","ml-block-form"];e.forEach(function(e){i.classList.contains(e)&&(t=e)})}if(t){let e=jQuery("form."+t).find('button[type="submit"]');void 0!==e&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(i,n,c)})}else document.forms[e].onsubmit=function(e){e.preventDefault();var t=jQuery(e.currentTarget).prev(),o=jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget,t,o)}}else-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((a=document.createElement("input")).name="cleantalk_hidden_action",a.value=o.action,a.type="hidden",o.appendChild(a),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var a=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(a.val())})})}function isIntegratedForm(e){var t=e.action;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com"))}function sendAjaxCheckingFormData(i,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(i),apbct_visible_fields_set_cookie(o),{}),o=i.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n,a,c){void 0!==e.apbct&&+e.apbct.blocked||(apbct_replace_inputs_values_from_other_form(jQuery(i).detach(),c),a.after(c),0===(e=jQuery(c).find("button[type=submit]")).length&&0===(e=jQuery(c).find("input[type=submit]")).length&&0===(e=jQuery(c).find('button[data-element="submit"]')).length&&0===(e=jQuery(c).find('input[type="image"][name="submit"]')).length||e[0].click())},callback_context:null,callback_params:[e,t]})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",jQuery.ajax({type:"POST",url:ctPublicFunctions._ajax_url,datatype:"text",data:o,success:function(e){if("true"!=e)return alert(e),!1;t.submit()},error:function(){t.submit()}})}function ct_check_internal__is_exclude_form(t){let e=[ctPublic.blog_home+"wp-login.php",ctPublic.blog_home+"wp-comments-post.php"];return e.some(e=>null!==t.match(new RegExp("^"+e)))}apbct_attach_event_handler(window,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(window,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(window,"scroll",ctSetHasScrolled),apbct_attach_event_handler(window,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){console.log(e.toString())}void 0!==n.apbct&&(n=n.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:n.comment}})),cleantalkModal.loaded=n.comment,cleantalkModal.open(),1==+n.stop_script&&window.stop())}}),cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},l=document.createElement("style"),i=(l.setAttribute("id","cleantalk-modal-styles"),l.innerHTML="body.cleantalk-modal-opened{"+i+"}",l.innerHTML+="#cleantalk-modal-overlay{"+t+"}",l.innerHTML+="#cleantalk-modal-close{"+n+"}",l.innerHTML+="#cleantalk-modal-close:before{"+a+"}",l.innerHTML+="#cleantalk-modal-close:after{"+c+"}",document.body.append(l),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),a=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?a.innerHTML=this.loaded:(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),jQuery(document).ready(function(){"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms&&ctPublicGDPR.gdpr_forms.forEach(function(e,t,o){var n=jQuery("#"+e+", ."+e);n.is("form")||(n.find("form")[0]?n=n.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?n=jQuery(".wpcf7[role=form]"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?n=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(n=jQuery(".wpforms-form"))),!n.is("form")&&"form"!==n.attr("role")||n.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required " style="display: inline; margin-right: 10px;">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>")})}),window.onload=function(){+ctPublic.settings__forms__check_external&&setTimeout(function(){ct_protect_external()},1500)},jQuery(document).ready(function(){let t="",o;if(+ctPublic.settings__forms__check_internal)for(let e=0;e<document.forms.length;e++)"string"==typeof document.forms[e].action&&(o=document.forms[e],null===(t=o.action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(ctPrevHandler=o.click,jQuery(o).off("**"),jQuery(o).off(),jQuery(o).on("submit",function(e){return ct_check_internal(e.target),!1})))});
lib/Cleantalk/Antispam/Integrations/ContactBank.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Cleantalk\Antispam\Integrations;
4
 
5
- use Cleantalk\Variables\Request;
6
 
7
  class ContactBank extends IntegrationBase
8
  {
2
 
3
  namespace Cleantalk\Antispam\Integrations;
4
 
5
+ use Cleantalk\ApbctWP\Variables\Request;
6
 
7
  class ContactBank extends IntegrationBase
8
  {
lib/Cleantalk/Antispam/Integrations/FluentForm.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace Cleantalk\Antispam\Integrations;
4
 
 
5
  use Cleantalk\ApbctWP\Variables\Post;
6
 
7
  class FluentForm extends IntegrationBase
@@ -11,12 +12,15 @@ class FluentForm extends IntegrationBase
11
  if ( Post::get('data') ) {
12
  parse_str(Post::get('data'), $form_data);
13
 
 
 
 
14
  /**
15
  * Filter for POST
16
  */
17
  $input_array = apply_filters('apbct__filter_post', $form_data);
18
 
19
- return ct_get_fields_any($input_array);
20
  }
21
 
22
  return null;
2
 
3
  namespace Cleantalk\Antispam\Integrations;
4
 
5
+ use Cleantalk\ApbctWP\Sanitize;
6
  use Cleantalk\ApbctWP\Variables\Post;
7
 
8
  class FluentForm extends IntegrationBase
12
  if ( Post::get('data') ) {
13
  parse_str(Post::get('data'), $form_data);
14
 
15
+ parse_str($_POST['data'], $form_data_dirty);
16
+ $email = $form_data_dirty['email'] ? Sanitize::cleanEmail($form_data_dirty['email']) : null;
17
+
18
  /**
19
  * Filter for POST
20
  */
21
  $input_array = apply_filters('apbct__filter_post', $form_data);
22
 
23
+ return ct_get_fields_any($input_array, $email);
24
  }
25
 
26
  return null;
lib/Cleantalk/ApbctWP/RemoteCalls.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Cleantalk\ApbctWP;
4
 
5
- use Cleantalk\Variables\Request;
6
 
7
  class RemoteCalls
8
  {
2
 
3
  namespace Cleantalk\ApbctWP;
4
 
5
+ use Cleantalk\ApbctWP\Variables\Request;
6
 
7
  class RemoteCalls
8
  {
lib/Cleantalk/ApbctWP/Variables/Get.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace Cleantalk\ApbctWP\Variables;
4
 
 
 
5
  class Get extends \Cleantalk\Variables\Get
6
  {
7
  /**
2
 
3
  namespace Cleantalk\ApbctWP\Variables;
4
 
5
+ use Cleantalk\ApbctWP\Validate;
6
+
7
  class Get extends \Cleantalk\Variables\Get
8
  {
9
  /**
lib/Cleantalk/ApbctWP/Variables/Post.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace Cleantalk\ApbctWP\Variables;
4
 
 
 
5
  class Post extends \Cleantalk\Variables\Post
6
  {
7
  /**
2
 
3
  namespace Cleantalk\ApbctWP\Variables;
4
 
5
+ use Cleantalk\ApbctWP\Validate;
6
+
7
  class Post extends \Cleantalk\Variables\Post
8
  {
9
  /**
lib/Cleantalk/ApbctWP/Variables/Request.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Cleantalk\ApbctWP\Variables;
4
+
5
+ use Cleantalk\ApbctWP\Validate;
6
+
7
+ class Request extends \Cleantalk\Variables\Request
8
+ {
9
+ /**
10
+ * @inheritDoc
11
+ */
12
+ protected function sanitizeDefault($value)
13
+ {
14
+ return sanitize_textarea_field($value);
15
+ }
16
+ }
lib/Cleantalk/Variables/Cookie.php CHANGED
@@ -10,7 +10,7 @@ namespace Cleantalk\Variables;
10
  *
11
  * @package Cleantalk\Variables
12
  */
13
- class Cookie extends ServerVariables
14
  {
15
  protected static $instance;
16
 
10
  *
11
  * @package Cleantalk\Variables
12
  */
13
+ abstract class Cookie extends ServerVariables
14
  {
15
  protected static $instance;
16
 
lib/Cleantalk/Variables/Get.php CHANGED
@@ -10,7 +10,7 @@ namespace Cleantalk\Variables;
10
  *
11
  * @package Cleantalk\Variables
12
  */
13
- class Get extends ServerVariables
14
  {
15
  protected static $instance;
16
 
10
  *
11
  * @package Cleantalk\Variables
12
  */
13
+ abstract class Get extends ServerVariables
14
  {
15
  protected static $instance;
16
 
lib/Cleantalk/Variables/Post.php CHANGED
@@ -10,7 +10,7 @@ namespace Cleantalk\Variables;
10
  *
11
  * @package Cleantalk\Variables
12
  */
13
- class Post extends ServerVariables
14
  {
15
  protected static $instance;
16
 
10
  *
11
  * @package Cleantalk\Variables
12
  */
13
+ abstract class Post extends ServerVariables
14
  {
15
  protected static $instance;
16
 
lib/Cleantalk/Variables/Request.php CHANGED
@@ -10,7 +10,7 @@ namespace Cleantalk\Variables;
10
  *
11
  * @package Cleantalk\Variables
12
  */
13
- class Request extends ServerVariables
14
  {
15
  protected static $instance;
16
 
@@ -20,6 +20,7 @@ class Request extends ServerVariables
20
  * @param $name
21
  *
22
  * @return mixed|string
 
23
  */
24
  protected function getVariable($name)
25
  {
@@ -30,12 +31,16 @@ class Request extends ServerVariables
30
 
31
  $value = '';
32
 
33
- if ( Post::get($name) ) {
34
- $value = Post::get($name);
35
- } elseif ( Get::get($name) ) {
36
- $value = Get::get($name);
37
- } elseif ( Cookie::get($name) ) {
38
- $value = Cookie::get($name);
 
 
 
 
39
  }
40
 
41
  // Remember for further calls
10
  *
11
  * @package Cleantalk\Variables
12
  */
13
+ abstract class Request extends ServerVariables
14
  {
15
  protected static $instance;
16
 
20
  * @param $name
21
  *
22
  * @return mixed|string
23
+ * @throws \ReflectionException
24
  */
25
  protected function getVariable($name)
26
  {
31
 
32
  $value = '';
33
 
34
+ $class_name = get_class(self::getInstance());
35
+ $reflection_class = new \ReflectionClass($class_name);
36
+ $namespace = $reflection_class->getNamespaceName();
37
+
38
+ if ( $namespace . '\\' . Post::get($name) ) {
39
+ $value = $namespace . '\\' . Post::get($name);
40
+ } elseif ( $namespace . '\\' . Get::get($name) ) {
41
+ $value = $namespace . '\\' . Get::get($name);
42
+ } elseif ( $namespace . '\\' . Cookie::get($name) ) {
43
+ $value = $namespace . '\\' . Cookie::get($name);
44
  }
45
 
46
  // Remember for further calls
lib/Cleantalk/Variables/Server.php CHANGED
@@ -10,7 +10,7 @@ namespace Cleantalk\Variables;
10
  *
11
  * @package \CleantalkSP\Variables
12
  */
13
- class Server extends ServerVariables
14
  {
15
  protected static $instance;
16
 
10
  *
11
  * @package \CleantalkSP\Variables
12
  */
13
+ abstract class Server extends ServerVariables
14
  {
15
  protected static $instance;
16
 
lib/Cleantalk/Variables/ServerVariables.php CHANGED
@@ -105,7 +105,7 @@ abstract class ServerVariables
105
  *
106
  * @return string|array
107
  */
108
- public function getAndSanitize(&$value, $nesting = 0)
109
  {
110
  if ( is_array($value) ) {
111
  foreach ( $value as $_key => & $val ) {
@@ -133,9 +133,5 @@ abstract class ServerVariables
133
  *
134
  * @return string
135
  */
136
- protected function sanitizeDefault($value)
137
- {
138
- // @ToDo Override this method in the internal class!
139
- return $value;
140
- }
141
  }
105
  *
106
  * @return string|array
107
  */
108
+ public function getAndSanitize($value, $nesting = 0)
109
  {
110
  if ( is_array($value) ) {
111
  foreach ( $value as $_key => & $val ) {
133
  *
134
  * @return string
135
  */
136
+ abstract protected function sanitizeDefault($value);
 
 
 
 
137
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
- Stable tag: 5.182.1
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -602,6 +602,18 @@ If your website has forms that send data to external sources, you can enable opt
602
 
603
  == Changelog ==
604
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  = 5.182.1 Aug 04 2022 =
606
  #### Server variables getting fixed.
607
  * New. Server variables. Sanitizing logic added.
4
  Requires at least: 3.0
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
+ Stable tag: 5.182.2
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
602
 
603
  == Changelog ==
604
 
605
+ = 5.182.2 Aug 08 2022 =
606
+ #### Server variables sanitizing fixed, js key getting fixed, internal forms catching fixed.
607
+ * Fix: removed & in getAndSanitize()
608
+ * Fix: ct_add_hidden_fields() - the data in the locale storage is added in json format
609
+ * Fix: Excluded wp-comments-post.php form from internal scripts
610
+ * Fix. Server variables. ServerVariables::sanitizeDefault() method is abstract now.
611
+ * Fix. Server variables. Common\Variables\* classes are abstract now.
612
+ * Fix. Server variables. Default sanitizing method implementation added to ApbctWP\Variables\* classes.
613
+ * Fix. Server variables. Client code fixed.
614
+ * Fix: FluentForm integration fixed
615
+ * Fix. Server variables. Url decoding removed.
616
+
617
  = 5.182.1 Aug 04 2022 =
618
  #### Server variables getting fixed.
619
  * New. Server variables. Sanitizing logic added.