Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.157.1

Version Description

Apr 29 2021 = * Mod: \Cleantalk\ApbctWP\Variables\Cookie::get() now has 'cast_to' param. If defined trying to cast to a given type. * Fix: \Cleantalk\ApbctWP\Variables\Cookie::get() calls using 'cast_to' param if needed.

Download this release

Release Info

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

Code changes from version 5.157 to 5.157.1

cleantalk.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: https://cleantalk.org
5
  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.
6
- Version: 5.157
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: https://cleantalk.org
9
  Text Domain: cleantalk-spam-protect
@@ -1589,7 +1589,7 @@ function apbct_store__urls(){
1589
  $current_url = $current_url ? substr($current_url, 0,256) : 'UNKNOWN';
1590
 
1591
  // Get already stored URLs
1592
- $urls = \Cleantalk\ApbctWP\Variables\Cookie::get( 'apbct_urls', array() );
1593
  $urls[$current_url][] = time();
1594
 
1595
  // Rotating. Saving only latest 10
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: https://cleantalk.org
5
  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.
6
+ Version: 5.157.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: https://cleantalk.org
9
  Text Domain: cleantalk-spam-protect
1589
  $current_url = $current_url ? substr($current_url, 0,256) : 'UNKNOWN';
1590
 
1591
  // Get already stored URLs
1592
+ $urls = \Cleantalk\ApbctWP\Variables\Cookie::get( 'apbct_urls', array(), 'array' );
1593
  $urls[$current_url][] = time();
1594
 
1595
  // Rotating. Saving only latest 10
inc/cleantalk-common.php CHANGED
@@ -390,7 +390,7 @@ function apbct_get_sender_info() {
390
  : null;
391
 
392
  // Visible fields processing
393
- $visible_fields = apbct_visible_fields__process( Cookie::get( 'apbct_visible_fields' ) );
394
 
395
  return array(
396
  'plugin_request_id' => $apbct->plugin_request_id,
@@ -825,7 +825,7 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
825
  if( apbct_array( array( $_POST, $_GET ) )->get_keys( $skip_params )->result() )
826
  $contact = false;
827
 
828
- $visible_fields = apbct_visible_fields__process( Cookie::get( 'apbct_visible_fields' ) );
829
  $visible_fields_arr = isset( $visible_fields['visible_fields'] ) ? explode( ' ', $visible_fields['visible_fields'] ) : array();
830
 
831
  if(count($arr)){
390
  : null;
391
 
392
  // Visible fields processing
393
+ $visible_fields = apbct_visible_fields__process( Cookie::get( 'apbct_visible_fields' , array(), 'array' ) );
394
 
395
  return array(
396
  'plugin_request_id' => $apbct->plugin_request_id,
825
  if( apbct_array( array( $_POST, $_GET ) )->get_keys( $skip_params )->result() )
826
  $contact = false;
827
 
828
+ $visible_fields = apbct_visible_fields__process( Cookie::get( 'apbct_visible_fields', array(), 'array' ) );
829
  $visible_fields_arr = isset( $visible_fields['visible_fields'] ) ? explode( ' ', $visible_fields['visible_fields'] ) : array();
830
 
831
  if(count($arr)){
inc/cleantalk-updater.php CHANGED
@@ -916,7 +916,7 @@ function apbct_update_to_5_157_0(){
916
  $apbct->remote_calls['sfw_update__worker'] = array( 'last_call' => 0, 'cooldown' => 0 );
917
  $apbct->save( 'remote_calls' );
918
 
919
- if( $apbct->settings['data__set_cookies__sessions'] ){
920
  $apbct->settings['data__set_cookies'] = 2;
921
  }
922
  $apbct->settings['data__set_cookies__alt_sessions_type'] = 1;
916
  $apbct->remote_calls['sfw_update__worker'] = array( 'last_call' => 0, 'cooldown' => 0 );
917
  $apbct->save( 'remote_calls' );
918
 
919
+ if( ! empty( $apbct->settings['data__set_cookies__sessions'] ) ){
920
  $apbct->settings['data__set_cookies'] = 2;
921
  }
922
  $apbct->settings['data__set_cookies__alt_sessions_type'] = 1;
lib/Cleantalk/ApbctWP/Variables/Cookie.php CHANGED
@@ -8,7 +8,7 @@ use Cleantalk\Variables\Server;
8
 
9
  class Cookie extends \Cleantalk\Variables\Cookie {
10
 
11
- public static function get( $name, $default = '', $raw = false ){
12
 
13
  global $apbct;
14
 
@@ -44,6 +44,10 @@ class Cookie extends \Cleantalk\Variables\Cookie {
44
  if( ! $raw ){
45
  $value = urldecode( $value ); // URL decode
46
  $value = Helper::is_json( $value ) ? json_decode( $value, true ) : $value; // JSON decode
 
 
 
 
47
  }
48
 
49
  return ! $value ? $default : $value;
8
 
9
  class Cookie extends \Cleantalk\Variables\Cookie {
10
 
11
+ public static function get( $name, $default = '', $cast_to = null, $raw = false ){
12
 
13
  global $apbct;
14
 
44
  if( ! $raw ){
45
  $value = urldecode( $value ); // URL decode
46
  $value = Helper::is_json( $value ) ? json_decode( $value, true ) : $value; // JSON decode
47
+ if( ! is_null( $cast_to ) ){
48
+ settype( $value, $cast_to );
49
+ $value = $cast_to === 'array' && $value === array('') ? array() : $value;
50
+ }
51
  }
52
 
53
  return ! $value ? $default : $value;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.7
6
  Requires PHP: 5.4
7
- Stable tag: 5.157
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -580,6 +580,10 @@ If your website has forms that send data to external sources, you can enable opt
580
 
581
  == Changelog ==
582
 
 
 
 
 
583
  = 5.157 Apr 28 2021 =
584
  * New: Invisible fields collecting implemented.
585
  * New: A dev and a fix version suffix support.
4
  Requires at least: 3.0
5
  Tested up to: 5.7
6
  Requires PHP: 5.4
7
+ Stable tag: 5.157.1
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
580
 
581
  == Changelog ==
582
 
583
+ = 5.157.1 Apr 29 2021 =
584
+ * Mod: \Cleantalk\ApbctWP\Variables\Cookie::get() now has 'cast_to' param. If defined trying to cast to a given type.
585
+ * Fix: \Cleantalk\ApbctWP\Variables\Cookie::get() calls using 'cast_to' param if needed.
586
+
587
  = 5.157 Apr 28 2021 =
588
  * New: Invisible fields collecting implemented.
589
  * New: A dev and a fix version suffix support.