Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.130

Version Description

November 14 2019 = * Fix: JetPack contact form JS check. * FIx: Iphorm AJAX form. * Fix: Paid Memberships Pro fix. * Fix: Divi theme contact form fix. * Integration: Paid Memberships Pro. * Integration: Elementor Pro page builder forms. * Improved: Compatibility with different server.

Download this release

Release Info

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

Code changes from version 5.129.1 to 5.130

cleantalk.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://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.129.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  Text Domain: cleantalk
@@ -156,6 +156,14 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
156
  }
157
 
158
  // Early checks
 
 
 
 
 
 
 
 
159
  // Facebook
160
  if ($apbct->settings['general_contact_forms_test'] == 1
161
  && (!empty($_POST['action']) && $_POST['action'] == 'fb_intialize')
@@ -170,7 +178,7 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
170
  }
171
 
172
  // Ninja Forms. Making GET action to POST action
173
- if(stripos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'admin-ajax.php') !== false && sizeof($_POST) > 0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit')
174
  $_POST['action']='ninja_forms_ajax_submit';
175
 
176
  add_action( 'wp_ajax_nopriv_ninja_forms_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
@@ -189,6 +197,10 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
189
  add_action( 'wp_ajax_nopriv_dt_send_mail', 'apbct_form__the7_contact_form', 1 );
190
  add_action( 'wp_ajax_dt_send_mail', 'apbct_form__the7_contact_form', 1 );
191
 
 
 
 
 
192
  // Public actions
193
  if(!is_admin() && !apbct_is_ajax()){
194
 
@@ -204,7 +216,7 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
204
  // SpamFireWall check
205
  if( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start
206
  $apbct->settings['spam_firewall'] == 1 &&
207
- filter_input(INPUT_SERVER, 'REQUEST_METHOD') == 'GET'
208
  ){
209
  apbct_sfw__check();
210
  }
@@ -235,8 +247,8 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
235
  add_action('plugins_loaded', 'apbct_plugin_loaded' );
236
 
237
  if( !empty($apbct->settings['use_ajax']) &&
238
- stripos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'.xml')===false &&
239
- stripos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'.xsl')===false)
240
  {
241
  add_action( 'wp_ajax_nopriv_ct_get_cookie', 'ct_get_cookie',1 );
242
  add_action( 'wp_ajax_ct_get_cookie', 'ct_get_cookie',1 );
@@ -333,7 +345,7 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
333
  if($pagenow=='users.php')
334
  add_action('delete_user', 'apbct_user__delete__hook', 10, 2);
335
 
336
- if($pagenow=='plugins.php' || (strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'plugins.php') !== false)){
337
 
338
  add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'apbct_admin__plugin_action_links', 10, 2);
339
  add_filter('network_admin_plugin_action_links_'.plugin_basename(__FILE__), 'apbct_admin__plugin_action_links', 10, 2);
@@ -508,7 +520,7 @@ function apbct_sfw__check()
508
  if (!empty($cleantalk_url_exclusions) && is_array($cleantalk_url_exclusions)) {
509
  $core_page_to_skip_check = array('/feed');
510
  foreach (array_merge($cleantalk_url_exclusions, $core_page_to_skip_check) as $v) {
511
- if (stripos(filter_input(INPUT_SERVER, 'REQUEST_URI'), $v) !== false) {
512
  return;
513
  }
514
  }
@@ -545,8 +557,8 @@ function apbct_sfw__check()
545
  $spbc_key = !empty($spbc_settings['spbc_key']) ? $spbc_settings['spbc_key'] : false;
546
  if($_GET['access'] === $apbct->api_key || ($spbc_key !== false && $_GET['access'] === $spbc_key)){
547
  $is_sfw_check = false;
548
- setcookie ('spbc_firewall_pass_key', md5(filter_input(INPUT_SERVER, 'REMOTE_ADDR') . $spbc_key), time()+1200, '/');
549
- setcookie ('ct_sfw_pass_key', md5(filter_input(INPUT_SERVER, 'REMOTE_ADDR') . $apbct->api_key), time()+1200, '/');
550
  }
551
  unset($spbc_settings, $spbc_key);
552
  }
@@ -1233,7 +1245,8 @@ function apbct_rc__insert_auth_key($key, $plugin){
1233
 
1234
  $result = CleantalkAPI::method__notice_paid_till(
1235
  $key,
1236
- preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1) // Site URL
 
1237
  );
1238
 
1239
  if( empty( $result['error'] ) ) {
@@ -1319,10 +1332,8 @@ function apbct__hook__wp_logout__delete_trial_notice_cookie(){
1319
 
1320
  function apbct_alt_session__id__get(){
1321
  $id = CleantalkHelper::ip__get(array('real'))
1322
- .filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')
1323
- //.filter_input(INPUT_SERVER, 'HTTP_ACCEPT') // Could be different. Broke session id
1324
- .filter_input(INPUT_SERVER, 'HTTP_ACCEPT_LANGUAGE');
1325
- //.filter_input(INPUT_SERVER, 'HTTP_ACCEPT_ENCODING'); // Could be different. Broke session id
1326
  return hash('sha256', $id);
1327
  }
1328
 
@@ -1388,7 +1399,8 @@ function apbct_store__urls(){
1388
 
1389
  // URLs HISTORY
1390
  // Get current url
1391
- $current_url = filter_input(INPUT_SERVER, 'HTTP_HOST').filter_input(INPUT_SERVER, 'REQUEST_URI');
 
1392
  $current_url = $current_url ? substr($current_url, 0,256) : 'UNKNOWN';
1393
 
1394
  // Get already stored URLs
@@ -1409,7 +1421,7 @@ function apbct_store__urls(){
1409
 
1410
  // REFERER
1411
  // Get current fererer
1412
- $new_site_referer = filter_input(INPUT_SERVER, 'HTTP_REFERER');
1413
  $new_site_referer = $new_site_referer ? $new_site_referer : 'UNKNOWN';
1414
 
1415
  // Get already stored referer
@@ -1418,7 +1430,7 @@ function apbct_store__urls(){
1418
  : filter_input(INPUT_COOKIE, 'apbct_site_referer');
1419
 
1420
  // Save if empty
1421
- if(!$site_referer || parse_url($new_site_referer, PHP_URL_HOST) !== filter_input(INPUT_SERVER, 'HTTP_HOST')){
1422
 
1423
  $apbct->settings['store_urls__sessions']
1424
  ? apbct_alt_session__save('apbct_site_referer', $new_site_referer)
@@ -1477,12 +1489,12 @@ function apbct_cookie(){
1477
  }
1478
 
1479
  // Pervious referer
1480
- if(filter_input(INPUT_SERVER, 'HTTP_REFERER')){
1481
  $apbct->settings['set_cookies__sessions']
1482
- ? apbct_alt_session__save('apbct_prev_referer', filter_input(INPUT_SERVER, 'HTTP_REFERER'))
1483
- : setcookie('apbct_prev_referer', filter_input(INPUT_SERVER, 'HTTP_REFERER'), 0, '/', $domain, false, true);
1484
  $cookie_test_value['cookies_names'][] = 'apbct_prev_referer';
1485
- $cookie_test_value['check_value'] .= filter_input(INPUT_SERVER, 'HTTP_REFERER');
1486
  }
1487
 
1488
  // Landing time
@@ -1597,7 +1609,8 @@ function ct_account_status_check($api_key = null, $process_errors = true){
1597
  $api_key = $api_key ? $api_key : $apbct->api_key;
1598
  $result = CleantalkAPI::method__notice_paid_till(
1599
  $api_key,
1600
- preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1)
 
1601
  );
1602
 
1603
  if(empty($result['error']) || !empty($result['valid'])){
@@ -1656,7 +1669,7 @@ function ct_mail_send_connection_report() {
1656
  if (($apbct->settings['send_connection_reports'] == 1 && $apbct->connection_reports['negative'] > 0) || !empty($_GET['ct_send_connection_report']))
1657
  {
1658
  $to = "welcome@cleantalk.org" ;
1659
- $subject = "Connection report for ".filter_input(INPUT_SERVER, 'HTTP_HOST');
1660
  $message = '
1661
  <html>
1662
  <head>
@@ -1858,25 +1871,3 @@ function apbct_update__set_version__from_plugin($ver){
1858
  $apbct->saveData();
1859
  return true;
1860
  }
1861
-
1862
- function apbct_http_method(){
1863
- $method = filter_input(INPUT_SERVER, 'REQUEST_METHOD');
1864
- return is_string($method) ? strtoupper( $method ) : '';
1865
- }
1866
-
1867
- function apbct_is_post(){
1868
- return apbct_http_method() === 'POST';
1869
- }
1870
-
1871
- function apbct_is_get(){
1872
- return apbct_http_method() === 'GET';
1873
- }
1874
-
1875
- function apbct_is_in_referer( $str ){
1876
- return isset( $_SERVER['HTTP_REFERER'] ) && strpos( $_SERVER['HTTP_REFERER'], $str ) !== false;
1877
- }
1878
-
1879
- function apbct_is_in_uri( $str ){
1880
- return isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], $str ) !== false;
1881
-
1882
- }
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://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.130
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  Text Domain: cleantalk
156
  }
157
 
158
  // Early checks
159
+
160
+ // Iphorm
161
+ if( isset( $_POST['iphorm_ajax'], $_POST['iphorm_id'], $_POST['iphorm_uid'] ) ){
162
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
163
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
164
+ ct_ajax_hook();
165
+ }
166
+
167
  // Facebook
168
  if ($apbct->settings['general_contact_forms_test'] == 1
169
  && (!empty($_POST['action']) && $_POST['action'] == 'fb_intialize')
178
  }
179
 
180
  // Ninja Forms. Making GET action to POST action
181
+ if( apbct_is_in_uri( 'admin-ajax.php' ) && sizeof($_POST) > 0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit' )
182
  $_POST['action']='ninja_forms_ajax_submit';
183
 
184
  add_action( 'wp_ajax_nopriv_ninja_forms_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
197
  add_action( 'wp_ajax_nopriv_dt_send_mail', 'apbct_form__the7_contact_form', 1 );
198
  add_action( 'wp_ajax_dt_send_mail', 'apbct_form__the7_contact_form', 1 );
199
 
200
+ // Elementor Pro page builder forms
201
+ add_action( 'wp_ajax_elementor_pro_forms_send_form', 'apbct_form__elementor_pro__testSpam' );
202
+ add_action( 'wp_ajax_nopriv_elementor_pro_forms_send_form', 'apbct_form__elementor_pro__testSpam' );
203
+
204
  // Public actions
205
  if(!is_admin() && !apbct_is_ajax()){
206
 
216
  // SpamFireWall check
217
  if( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start
218
  $apbct->settings['spam_firewall'] == 1 &&
219
+ apbct_is_get()
220
  ){
221
  apbct_sfw__check();
222
  }
247
  add_action('plugins_loaded', 'apbct_plugin_loaded' );
248
 
249
  if( !empty($apbct->settings['use_ajax']) &&
250
+ ! apbct_is_in_uri( '.xml' ) &&
251
+ ! apbct_is_in_uri( '.xsl' ) )
252
  {
253
  add_action( 'wp_ajax_nopriv_ct_get_cookie', 'ct_get_cookie',1 );
254
  add_action( 'wp_ajax_ct_get_cookie', 'ct_get_cookie',1 );
345
  if($pagenow=='users.php')
346
  add_action('delete_user', 'apbct_user__delete__hook', 10, 2);
347
 
348
+ if( $pagenow=='plugins.php' || apbct_is_in_uri( 'plugins.php' ) ){
349
 
350
  add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'apbct_admin__plugin_action_links', 10, 2);
351
  add_filter('network_admin_plugin_action_links_'.plugin_basename(__FILE__), 'apbct_admin__plugin_action_links', 10, 2);
520
  if (!empty($cleantalk_url_exclusions) && is_array($cleantalk_url_exclusions)) {
521
  $core_page_to_skip_check = array('/feed');
522
  foreach (array_merge($cleantalk_url_exclusions, $core_page_to_skip_check) as $v) {
523
+ if ( apbct_is_in_uri( $v ) ) {
524
  return;
525
  }
526
  }
557
  $spbc_key = !empty($spbc_settings['spbc_key']) ? $spbc_settings['spbc_key'] : false;
558
  if($_GET['access'] === $apbct->api_key || ($spbc_key !== false && $_GET['access'] === $spbc_key)){
559
  $is_sfw_check = false;
560
+ setcookie ('spbc_firewall_pass_key', md5(apbct_get_server_variable( 'REMOTE_ADDR' ) . $spbc_key), time()+1200, '/');
561
+ setcookie ('ct_sfw_pass_key', md5(apbct_get_server_variable( 'REMOTE_ADDR' ) . $apbct->api_key), time()+1200, '/');
562
  }
563
  unset($spbc_settings, $spbc_key);
564
  }
1245
 
1246
  $result = CleantalkAPI::method__notice_paid_till(
1247
  $key,
1248
+ preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1), // Site URL
1249
+ 'antispam'
1250
  );
1251
 
1252
  if( empty( $result['error'] ) ) {
1332
 
1333
  function apbct_alt_session__id__get(){
1334
  $id = CleantalkHelper::ip__get(array('real'))
1335
+ .apbct_get_server_variable( 'HTTP_USER_AGENT' )
1336
+ .apbct_get_server_variable( 'HTTP_ACCEPT_LANGUAGE' );
 
 
1337
  return hash('sha256', $id);
1338
  }
1339
 
1399
 
1400
  // URLs HISTORY
1401
  // Get current url
1402
+ $current_url = apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' );
1403
+
1404
  $current_url = $current_url ? substr($current_url, 0,256) : 'UNKNOWN';
1405
 
1406
  // Get already stored URLs
1421
 
1422
  // REFERER
1423
  // Get current fererer
1424
+ $new_site_referer = apbct_get_server_variable( 'HTTP_REFERER' );
1425
  $new_site_referer = $new_site_referer ? $new_site_referer : 'UNKNOWN';
1426
 
1427
  // Get already stored referer
1430
  : filter_input(INPUT_COOKIE, 'apbct_site_referer');
1431
 
1432
  // Save if empty
1433
+ if( !$site_referer || parse_url($new_site_referer, PHP_URL_HOST) !== apbct_get_server_variable( 'HTTP_HOST' ) ){
1434
 
1435
  $apbct->settings['store_urls__sessions']
1436
  ? apbct_alt_session__save('apbct_site_referer', $new_site_referer)
1489
  }
1490
 
1491
  // Pervious referer
1492
+ if(apbct_get_server_variable( 'HTTP_REFERER' )){
1493
  $apbct->settings['set_cookies__sessions']
1494
+ ? apbct_alt_session__save('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ))
1495
+ : setcookie('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ), 0, '/', $domain, false, true);
1496
  $cookie_test_value['cookies_names'][] = 'apbct_prev_referer';
1497
+ $cookie_test_value['check_value'] .= apbct_get_server_variable( 'HTTP_REFERER' );
1498
  }
1499
 
1500
  // Landing time
1609
  $api_key = $api_key ? $api_key : $apbct->api_key;
1610
  $result = CleantalkAPI::method__notice_paid_till(
1611
  $api_key,
1612
+ preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1),
1613
+ 'antispam'
1614
  );
1615
 
1616
  if(empty($result['error']) || !empty($result['valid'])){
1669
  if (($apbct->settings['send_connection_reports'] == 1 && $apbct->connection_reports['negative'] > 0) || !empty($_GET['ct_send_connection_report']))
1670
  {
1671
  $to = "welcome@cleantalk.org" ;
1672
+ $subject = "Connection report for " . apbct_get_server_variable( 'HTTP_HOST' );
1673
  $message = '
1674
  <html>
1675
  <head>
1871
  $apbct->saveData();
1872
  return true;
1873
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cleantalk-ajax.php CHANGED
@@ -257,6 +257,7 @@ function ct_ajax_hook($message_obj = false, $additional = false)
257
 
258
  // Go out because of not spam data
259
  $skip_post = array(
 
260
  'gmaps_display_info_window', // Geo My WP pop-up windows.
261
  'gmw_ps_display_info_window', // Geo My WP pop-up windows.
262
  'the_champ_user_auth', // Super Socializer
@@ -286,12 +287,12 @@ function ct_ajax_hook($message_obj = false, $additional = false)
286
  'formcraft3_save_form_progress', // FormCraft – Contact Form Builder for WordPress. Save progress.
287
  'wpdmpp_save_settings', // PayPal save settings.
288
  );
289
-
290
  // Skip test if
291
  if( !$apbct->settings['general_contact_forms_test'] || // Test disabled
292
  !apbct_is_user_enable($apbct->user) || // User is admin, editor, author
293
  // (function_exists('get_current_user_id') && get_current_user_id() != 0) || // Check with default wp_* function if it's admin
294
- ($apbct->settings['protect_logged_in'] && ($apbct->user instanceof WP_User) && $apbct->user->ID !== 0 ) || // Logged in user
295
  apbct_exclusions_check__url() || // url exclusions
296
  (isset($_POST['action']) && in_array($_POST['action'], $skip_post)) || // Special params
297
  (isset($_GET['action']) && in_array($_GET['action'], $skip_post)) || // Special params
257
 
258
  // Go out because of not spam data
259
  $skip_post = array(
260
+ 'apbct_js_keys__get', // Our service code
261
  'gmaps_display_info_window', // Geo My WP pop-up windows.
262
  'gmw_ps_display_info_window', // Geo My WP pop-up windows.
263
  'the_champ_user_auth', // Super Socializer
287
  'formcraft3_save_form_progress', // FormCraft – Contact Form Builder for WordPress. Save progress.
288
  'wpdmpp_save_settings', // PayPal save settings.
289
  );
290
+
291
  // Skip test if
292
  if( !$apbct->settings['general_contact_forms_test'] || // Test disabled
293
  !apbct_is_user_enable($apbct->user) || // User is admin, editor, author
294
  // (function_exists('get_current_user_id') && get_current_user_id() != 0) || // Check with default wp_* function if it's admin
295
+ (!$apbct->settings['protect_logged_in'] && ($apbct->user instanceof WP_User) && $apbct->user->ID !== 0 ) || // Logged in user
296
  apbct_exclusions_check__url() || // url exclusions
297
  (isset($_POST['action']) && in_array($_POST['action'], $skip_post)) || // Special params
298
  (isset($_GET['action']) && in_array($_GET['action'], $skip_post)) || // Special params
inc/cleantalk-comments.php CHANGED
@@ -265,8 +265,8 @@ function ct_show_checkspam_page(){
265
  </div>
266
  <?php
267
  }
268
- echo filter_input(INPUT_SERVER, 'REMOTE_ADDR')=='127.0.0.1' ? '<button class="button ct_to_hide" id="ct_insert_comments">'. __('Insert comments', 'cleantalk') .' (100)</button> ' : '';
269
- echo filter_input(INPUT_SERVER, 'REMOTE_ADDR')=='127.0.0.1' ? '<button class="button ct_to_hide" id="ct_delete_comments">'. __('Delete comments', 'cleantalk') .' (110)</button>' : '';
270
 
271
  if($cnt_spam > 0){
272
  echo "<div id='ct_search_info'>"
265
  </div>
266
  <?php
267
  }
268
+ echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<button class="button ct_to_hide" id="ct_insert_comments">'. __('Insert comments', 'cleantalk') .' (100)</button> ' : '';
269
+ echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<button class="button ct_to_hide" id="ct_delete_comments">'. __('Delete comments', 'cleantalk') .' (110)</button>' : '';
270
 
271
  if($cnt_spam > 0){
272
  echo "<div id='ct_search_info'>"
inc/cleantalk-common.php CHANGED
@@ -155,7 +155,7 @@ function apbct_base_call($params = array(), $reg_flag = false){
155
  $apbct->data['connection_reports']['negative']++;
156
  $apbct->data['connection_reports']['negative_report'][] = array(
157
  'date' => date("Y-m-d H:i:s"),
158
- 'page_url' => filter_input(INPUT_SERVER, 'REQUEST_URI'),
159
  'lib_report' => $ct_result->errstr,
160
  'work_url' => $ct->work_url,
161
  );
@@ -189,7 +189,7 @@ function apbct_base_call($params = array(), $reg_flag = false){
189
  // Set cookies if it's not.
190
  if(empty($apbct->flags__cookies_setuped))
191
  apbct_cookie();
192
-
193
  return array('ct' => $ct, 'ct_result' => $ct_result);
194
 
195
  }
@@ -244,9 +244,9 @@ function apbct_exclusions_check__url() {
244
  $exclusions = explode( ',', $apbct->settings['exclusions__urls'] );
245
 
246
  // Fix for AJAX forms
247
- $haystack = filter_input(INPUT_SERVER, 'REQUEST_URI') == '/wp-admin/admin-ajax.php' && ! filter_input(INPUT_SERVER, 'HTTP_REFERER')
248
- ? filter_input(INPUT_SERVER, 'HTTP_REFERER')
249
- : filter_input(INPUT_SERVER, 'REQUEST_URI');
250
 
251
  foreach ( $exclusions as $exclusion ) {
252
  if (
@@ -270,15 +270,15 @@ function apbct_exclusions_check__ip(){
270
 
271
  global $cleantalk_ip_exclusions;
272
 
273
- if( filter_input(INPUT_SERVER, 'REMOTE_ADDR') ){
274
 
275
- if( CleantalkHelper::ip__is_cleantalks( filter_input(INPUT_SERVER, 'REMOTE_ADDR') ) ){
276
  return true;
277
  }
278
 
279
  if( ! empty( $cleantalk_ip_exclusions ) && is_array( $cleantalk_ip_exclusions ) ){
280
  foreach ( $cleantalk_ip_exclusions as $exclusion ){
281
- if( stripos( filter_input(INPUT_SERVER, 'REMOTE_ADDR'), $exclusion ) !== false ){
282
  return true;
283
  }
284
  }
@@ -320,8 +320,8 @@ function apbct_get_sender_info() {
320
  }
321
 
322
  // AMP check
323
- $amp_detected = filter_input(INPUT_SERVER, 'HTTP_REFERER')
324
- ? strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'), '/amp/') !== false || strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'), '?amp=1') !== false || strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'), '&amp=1') !== false
325
  ? 1
326
  : 0
327
  : null;
@@ -336,13 +336,13 @@ function apbct_get_sender_info() {
336
 
337
  return array(
338
  'remote_addr' => CleantalkHelper::ip__get(array('remote_addr'), false),
339
- 'REFFERRER' => filter_input(INPUT_SERVER, 'HTTP_REFERER') ? htmlspecialchars(filter_input(INPUT_SERVER, 'HTTP_REFERER')) : null,
340
- 'USER_AGENT' => filter_input(INPUT_SERVER, 'HTTP_USER_AGENT') ? htmlspecialchars(filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')) : null,
341
- 'page_url' => isset($_SERVER['SERVER_NAME'], $_SERVER['REQUEST_URI']) ? htmlspecialchars($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']) : null,
342
  'cms_lang' => substr(get_locale(), 0, 2),
343
  'ct_options' => json_encode($apbct->settings),
344
  'fields_number' => sizeof($_POST),
345
- 'direct_post' => $cookie_is_ok === null && filter_input(INPUT_SERVER, 'REQUEST_METHOD') == 'POST' ? 1 : 0,
346
  // Raw data to validated JavaScript test in the cloud
347
  'checkjs_data_cookies' => !empty($_COOKIE['ct_checkjs']) ? $_COOKIE['ct_checkjs'] : null,
348
  'checkjs_data_post' => !empty($checkjs_data_post) ? $checkjs_data_post : null,
@@ -368,7 +368,7 @@ function apbct_get_sender_info() {
368
  'headers_sent' => !empty($apbct->headers_sent) ? $apbct->headers_sent : false,
369
  'headers_sent__hook' => !empty($apbct->headers_sent__hook) ? $apbct->headers_sent__hook : false,
370
  'headers_sent__where' => !empty($apbct->headers_sent__where) ? $apbct->headers_sent__where : false,
371
- 'request_type' => filter_input(INPUT_SERVER, 'REQUEST_METHOD') ? filter_input(INPUT_SERVER, 'REQUEST_METHOD') : 'UNKNOWN',
372
  'abpct_hyro_acc_collect' => !empty($_COOKIE['abpct_hyro_acc_collect']) ? json_decode(stripslashes($_COOKIE['abpct_hyro_acc_collect']), true): null,
373
  );
374
  }
@@ -442,7 +442,7 @@ function ct_get_checkjs_value(){
442
  }elseif(
443
  $apbct->settings['use_static_js_key'] == - 1 &&
444
  ( apbct_is_cache_plugins_exists() ||
445
- ( strtolower( filter_input(INPUT_SERVER, 'REQUEST_METHOD') ) == 'post' && $apbct->data['cache_detected'] == 1 )
446
  )
447
  ){
448
  $key = hash('sha256', $apbct->api_key.ct_get_admin_email().$apbct->salt);
155
  $apbct->data['connection_reports']['negative']++;
156
  $apbct->data['connection_reports']['negative_report'][] = array(
157
  'date' => date("Y-m-d H:i:s"),
158
+ 'page_url' => apbct_get_server_variable( 'REQUEST_URI' ),
159
  'lib_report' => $ct_result->errstr,
160
  'work_url' => $ct->work_url,
161
  );
189
  // Set cookies if it's not.
190
  if(empty($apbct->flags__cookies_setuped))
191
  apbct_cookie();
192
+
193
  return array('ct' => $ct, 'ct_result' => $ct_result);
194
 
195
  }
244
  $exclusions = explode( ',', $apbct->settings['exclusions__urls'] );
245
 
246
  // Fix for AJAX forms
247
+ $haystack = apbct_get_server_variable( 'REQUEST_URI' ) == '/wp-admin/admin-ajax.php' && ! apbct_get_server_variable( 'HTTP_REFERER' )
248
+ ? apbct_get_server_variable( 'HTTP_REFERER' )
249
+ : apbct_get_server_variable( 'REQUEST_URI' );
250
 
251
  foreach ( $exclusions as $exclusion ) {
252
  if (
270
 
271
  global $cleantalk_ip_exclusions;
272
 
273
+ if( apbct_get_server_variable( 'REMOTE_ADDR' ) ){
274
 
275
+ if( CleantalkHelper::ip__is_cleantalks( apbct_get_server_variable( 'REMOTE_ADDR' ) ) ){
276
  return true;
277
  }
278
 
279
  if( ! empty( $cleantalk_ip_exclusions ) && is_array( $cleantalk_ip_exclusions ) ){
280
  foreach ( $cleantalk_ip_exclusions as $exclusion ){
281
+ if( stripos( apbct_get_server_variable( 'REMOTE_ADDR' ), $exclusion ) !== false ){
282
  return true;
283
  }
284
  }
320
  }
321
 
322
  // AMP check
323
+ $amp_detected = apbct_get_server_variable( 'HTTP_REFERER' )
324
+ ? strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '/amp/') !== false || strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '?amp=1') !== false || strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '&amp=1') !== false
325
  ? 1
326
  : 0
327
  : null;
336
 
337
  return array(
338
  'remote_addr' => CleantalkHelper::ip__get(array('remote_addr'), false),
339
+ 'REFFERRER' => apbct_get_server_variable( 'HTTP_REFERER' ),
340
+ 'USER_AGENT' => apbct_get_server_variable( 'HTTP_USER_AGENT' ),
341
+ 'page_url' => apbct_get_server_variable( 'SERVER_NAME' ) . apbct_get_server_variable( 'REQUEST_URI' ),
342
  'cms_lang' => substr(get_locale(), 0, 2),
343
  'ct_options' => json_encode($apbct->settings),
344
  'fields_number' => sizeof($_POST),
345
+ 'direct_post' => $cookie_is_ok === null && apbct_is_post() ? 1 : 0,
346
  // Raw data to validated JavaScript test in the cloud
347
  'checkjs_data_cookies' => !empty($_COOKIE['ct_checkjs']) ? $_COOKIE['ct_checkjs'] : null,
348
  'checkjs_data_post' => !empty($checkjs_data_post) ? $checkjs_data_post : null,
368
  'headers_sent' => !empty($apbct->headers_sent) ? $apbct->headers_sent : false,
369
  'headers_sent__hook' => !empty($apbct->headers_sent__hook) ? $apbct->headers_sent__hook : false,
370
  'headers_sent__where' => !empty($apbct->headers_sent__where) ? $apbct->headers_sent__where : false,
371
+ 'request_type' => apbct_get_server_variable('REQUEST_METHOD') ? apbct_get_server_variable('REQUEST_METHOD') : 'UNKNOWN',
372
  'abpct_hyro_acc_collect' => !empty($_COOKIE['abpct_hyro_acc_collect']) ? json_decode(stripslashes($_COOKIE['abpct_hyro_acc_collect']), true): null,
373
  );
374
  }
442
  }elseif(
443
  $apbct->settings['use_static_js_key'] == - 1 &&
444
  ( apbct_is_cache_plugins_exists() ||
445
+ ( apbct_is_post() && $apbct->data['cache_detected'] == 1 )
446
  )
447
  ){
448
  $key = hash('sha256', $apbct->api_key.ct_get_admin_email().$apbct->salt);
inc/cleantalk-pluggable.php CHANGED
@@ -71,7 +71,7 @@ function apbct_wp_validate_auth_cookie( $cookie = '', $scheme = '' ) {
71
  $expiration = $cookie_elements['expiration'];
72
 
73
  // Allow a grace period for POST and Ajax requests
74
- $expired = apbct_is_ajax() || 'POST' == filter_input(INPUT_SERVER, 'REQUEST_METHOD')
75
  ? $expiration + HOUR_IN_SECONDS
76
  : $cookie_elements['expiration'];
77
 
@@ -214,7 +214,7 @@ function apbct_is_ajax() {
214
 
215
  return
216
  (defined( 'DOING_AJAX' ) && DOING_AJAX) || // by standart WP functions
217
- (filter_input(INPUT_SERVER, 'HTTP_X_REQUESTED_WITH') && strtolower(filter_input(INPUT_SERVER, 'HTTP_X_REQUESTED_WITH')) == 'xmlhttprequest') || // by Request type
218
  !empty($_POST['quform_ajax']) || // special. QForms
219
  !empty($_POST['iphorm_ajax']); // special. IPHorm
220
 
@@ -229,4 +229,44 @@ function apbct_is_user_logged_in(){
229
  $siteurl = get_site_option( 'siteurl' );
230
  $cookiehash = $siteurl ? md5( $siteurl ) : '';
231
  return count($_COOKIE) && isset($_COOKIE['wordpress_logged_in_'.$cookiehash]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  }
71
  $expiration = $cookie_elements['expiration'];
72
 
73
  // Allow a grace period for POST and Ajax requests
74
+ $expired = apbct_is_ajax() || apbct_is_post()
75
  ? $expiration + HOUR_IN_SECONDS
76
  : $cookie_elements['expiration'];
77
 
214
 
215
  return
216
  (defined( 'DOING_AJAX' ) && DOING_AJAX) || // by standart WP functions
217
+ (apbct_get_server_variable( 'HTTP_X_REQUESTED_WITH' ) && strtolower(apbct_get_server_variable( 'HTTP_X_REQUESTED_WITH' )) == 'xmlhttprequest') || // by Request type
218
  !empty($_POST['quform_ajax']) || // special. QForms
219
  !empty($_POST['iphorm_ajax']); // special. IPHorm
220
 
229
  $siteurl = get_site_option( 'siteurl' );
230
  $cookiehash = $siteurl ? md5( $siteurl ) : '';
231
  return count($_COOKIE) && isset($_COOKIE['wordpress_logged_in_'.$cookiehash]);
232
+ }
233
+
234
+ /*
235
+ * GETTING SERVER VARIABLES BY VARIOUS WAYS
236
+ */
237
+ function apbct_get_server_variable( $server_variable_name ){
238
+
239
+ $var_name = strtoupper( $server_variable_name );
240
+
241
+ if( function_exists( 'filter_input' ) )
242
+ $value = filter_input( INPUT_SERVER, $var_name );
243
+
244
+ if( empty( $value ) )
245
+ $value = isset( $_SERVER[ $var_name ] ) ? $_SERVER[ $var_name ] : '';
246
+
247
+ // Convert to upper case for REQUEST_METHOD
248
+ if( in_array( $server_variable_name, array( 'REQUEST_METHOD' ) ) )
249
+ $value = strtoupper( $value );
250
+
251
+ // Convert HTML chars for HTTP_USER_AGENT, HTTP_USER_AGENT, SERVER_NAME
252
+ if( in_array( $server_variable_name, array( 'HTTP_USER_AGENT', 'HTTP_USER_AGENT', 'SERVER_NAME' ) ) )
253
+ $value = htmlspecialchars( $value );
254
+
255
+ return $value;
256
+ }
257
+
258
+ function apbct_is_post(){
259
+ return apbct_get_server_variable('REQUEST_METHOD') === 'POST';
260
+ }
261
+
262
+ function apbct_is_get(){
263
+ return apbct_get_server_variable('REQUEST_METHOD') === 'GET';
264
+ }
265
+
266
+ function apbct_is_in_referer( $str ){
267
+ return stripos( apbct_get_server_variable('HTTP_REFERER'), $str ) !== false;
268
+ }
269
+
270
+ function apbct_is_in_uri( $str ){
271
+ return stripos( apbct_get_server_variable('REQUEST_URI'), $str ) !== false;
272
  }
inc/cleantalk-public.php CHANGED
@@ -254,6 +254,25 @@ function apbct_init() {
254
  add_action( 'um_submit_form_register', 'apbct_registration__UltimateMembers__check', 9, 1 ); // Check submition
255
  }
256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  //
258
  // Load JS code to website footer
259
  //
@@ -428,7 +447,7 @@ function ct_validate_ccf_submission($value, $field_id, $required){
428
  $message['subject'] = $subject;
429
 
430
  $post_info['comment_type'] = 'feedback_custom_contact_forms';
431
- $post_info['post_url'] = filter_input(INPUT_SERVER, 'HTTP_REFERER');
432
 
433
  $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
434
  ? apbct_js_test('ct_checkjs', $_COOKIE)
@@ -462,7 +481,7 @@ function ct_woocommerce_wishlist_check($args){
462
  return $args;
463
 
464
  //If the IP is a Google bot
465
- $hostname = gethostbyaddr( filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) );
466
  if(!strpos($hostname, 'googlebot.com'))
467
  return $args;
468
 
@@ -476,7 +495,7 @@ function ct_woocommerce_wishlist_check($args){
476
  $nickname = '';
477
 
478
  $post_info['comment_type'] = 'feedback';
479
- $post_info['post_url'] = filter_input(INPUT_SERVER, 'HTTP_REFERER');
480
 
481
  $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
482
  ? apbct_js_test('ct_checkjs', $_COOKIE)
@@ -532,7 +551,7 @@ function apbct_integration__buddyPres__activityWall( $is_spam, $activity_obj = n
532
  'sender_email' => $curr_user->data->user_email,
533
  'sender_nickname' => $curr_user->data->user_login,
534
  'post_info' => array(
535
- 'post_url' => filter_input(INPUT_SERVER, 'HTTP_REFERER'),
536
  'comment_type' => 'buddypress_activitywall',
537
  ),
538
  'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
@@ -626,7 +645,7 @@ function apbct_integration__buddyPres__private_msg_check( $bp_message_obj){
626
  'sender_nickname' => $sender_user_obj->data->user_login,
627
  'post_info' => array(
628
  'comment_type' => 'buddypress_comment',
629
- 'post_url' => filter_input(INPUT_SERVER, 'HTTP_REFERER'),
630
  ),
631
  'js_on' => apbct_js_test('ct_checkjs', $_COOKIE)
632
  ? apbct_js_test('ct_checkjs', $_COOKIE)
@@ -723,7 +742,7 @@ function apbct_form__piratesForm__testSpam(){
723
  $message = array_merge(array('subject' => $subject), $message);
724
 
725
  $post_info['comment_type'] = 'contact_form_wordpress_feedback_pirate';
726
- $post_info['post_url'] = filter_input(INPUT_SERVER, 'HTTP_REFERER');
727
 
728
  //Making a call
729
  $base_call_result = apbct_base_call(
@@ -1133,8 +1152,8 @@ function ct_preprocess_comment($comment) {
1133
  $comment['comment_author_email'],
1134
  $comment['comment_author_url'],
1135
  $comment['comment_content'],
1136
- filter_input(INPUT_SERVER, 'REMOTE_ADDR'),
1137
- filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')
1138
  );
1139
 
1140
  // Go out if author in local blacklists
@@ -1200,7 +1219,7 @@ function ct_preprocess_comment($comment) {
1200
  ? null
1201
  : json_encode(array(
1202
  'validation_notice' => $apbct->validation_error,
1203
- 'page_url' => filter_input(INPUT_SERVER, 'HTTP_HOST') . filter_input(INPUT_SERVER, 'REQUEST_URI'),
1204
  ))
1205
  ),
1206
  )
@@ -1776,7 +1795,7 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
1776
  'form_validation' => ! empty( $errors )
1777
  ? json_encode( array(
1778
  'validation_notice' => $errors->get_error_message(),
1779
- 'page_url' => filter_input( INPUT_SERVER, 'HTTP_HOST' ) . filter_input( INPUT_SERVER, 'REQUEST_URI' ),
1780
  ) )
1781
  : null,
1782
  );
@@ -1963,12 +1982,10 @@ function apbct_user_register($user_id) {
1963
  * Test for JetPack contact form
1964
  */
1965
  function ct_grunion_contact_form_field_html($r, $field_label) {
 
1966
  global $ct_checkjs_jpcf, $ct_jpcf_patched, $ct_jpcf_fields, $apbct;
1967
-
1968
-
1969
-
1970
-
1971
- if ($apbct->settings['contact_forms_test'] == 1 && $ct_jpcf_patched === false && preg_match("/[text|email]/i", $r)) {
1972
 
1973
  // Looking for element name prefix
1974
  $name_patched = false;
@@ -2162,7 +2179,7 @@ function apbct_form__contactForm7__testSpam($param) {
2162
  ? null
2163
  : json_encode(array(
2164
  'validation_notice' => $apbct->validation_error,
2165
- 'page_url' => filter_input(INPUT_SERVER, 'HTTP_HOST') . filter_input(INPUT_SERVER, 'REQUEST_URI'),
2166
  ))
2167
  ),
2168
  )
@@ -2923,6 +2940,53 @@ function apbct_form__the7_contact_form() {
2923
 
2924
  }
2925
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2926
  /**
2927
  * General test for any contact form
2928
  */
@@ -2938,18 +3002,19 @@ function ct_contact_form_validate() {
2938
  (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
2939
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
2940
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
2941
- strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'),'lostpassword') !== false ||
2942
- (strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'/wp-admin/')!== false && (empty($_POST['your-phone']) && empty($_POST['your-email']) && empty($_POST['your-message']))) || //Bitrix24 Contact
2943
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'wp-login.php')!==false||
2944
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'wp-comments-post.php')!==false ||
2945
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'?provider=facebook&')!==false ||
2946
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'reset-password/')!==false || // Ticket #13668. Password reset.
2947
- strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'),'/wp-admin/') !== false ||
2948
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'/login/')!==false ||
2949
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'), '/my-account/edit-account/')!==false || // WooCommerce edit account page
2950
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'), '/my-account/edit-address/')!==false || // WooCommerce edit account page
 
2951
  (isset($_POST['action']) && $_POST['action'] == 'save_account_details') || // WooCommerce edit account action
2952
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'), '/peepsoajax/profilefieldsajax.validate_register')!== false ||
2953
  isset($_GET['ptype']) && $_GET['ptype']=='login' ||
2954
  isset($_POST['ct_checkjs_register_form']) ||
2955
  (isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
@@ -2957,7 +3022,7 @@ function ct_contact_form_validate() {
2957
  isset($_POST['bbp_topic_content']) ||
2958
  isset($_POST['bbp_reply_content']) ||
2959
  isset($_POST['fscf_submitted']) ||
2960
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'/wc-api/')!==false ||
2961
  isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit']) ||
2962
  isset($_POST[$ct_checkjs_frm]) && $apbct->settings['contact_forms_test'] == 1 ||// Formidable forms
2963
  isset($_POST['comment_post_ID']) || // The comment form
@@ -2969,25 +3034,24 @@ function ct_contact_form_validate() {
2969
  (isset($_POST['_wpcf7'], $_POST['_wpcf7_version'], $_POST['_wpcf7_locale'])) || //CF7 fix)
2970
  (isset($_POST['hash'], $_POST['device_unique_id'], $_POST['device_name'])) ||//Mobile Assistant Connector fix
2971
  isset($_POST['gform_submit']) || //Gravity form
2972
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'), 'wc-ajax=get_refreshed_fragments') !== false ||
2973
  (isset($_POST['ccf_form']) && intval($_POST['ccf_form']) == 1) ||
2974
  (isset($_POST['contact_tags']) && strpos($_POST['contact_tags'], 'MBR:') !== false) ||
2975
- (strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'), 'bizuno.php') && !empty($_POST['bizPass'])) ||
2976
- (strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'),'my-dashboard/') !== false) || // ticket_id=7885
2977
  isset($_POST['slm_action'], $_POST['license_key'], $_POST['secret_key'], $_POST['registered_domain']) || // ticket_id=9122
2978
  (isset($_POST['wpforms']['submit']) && $_POST['wpforms']['submit'] == 'wpforms-submit') || // WPForms
2979
  (isset($_POST['action']) && $_POST['action'] == 'grunion-contact-form') || // JetPack
2980
  (isset($_POST['action']) && $_POST['action'] == 'bbp-update-user') || //BBP update user info page
2981
- (strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'),'?wc-api=WC_Gateway_Transferuj') !== false) || //WC Gateway
2982
  (isset($_GET['mbr'], $_GET['amp;appname'], $_GET['amp;master'])) || // ticket_id=10773
2983
- (strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'),'lost-password') !== false) || //Skip lost-password form check
2984
  (isset($_POST['call_function']) && $_POST['call_function'] == 'push_notification_settings') || // Skip mobile requests (push settings)
2985
- (strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'membership-login')!==false ) || // Skip login form
2986
  (isset($_GET['cookie-state-change'])) || //skip GDPR plugin
2987
- (filter_input(INPUT_SERVER, 'HTTP_USER_AGENT') == 'MailChimp' && strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'), 'mc4wp-sync-api/webhook-listener') !== false) || // Mailchimp webhook skip
2988
- (strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'researcher-log-in')!==false ) || // Skip login form
2989
- (strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'admin_aspcms/_system/AspCms_SiteSetting.asp?action=saves')!==false ) || // Skip admin save callback
2990
- (strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'?profile_tab=postjobs')!==false ) || // Skip post vacancies
2991
  (isset($_POST['btn_insert_post_type_hotel']) && $_POST['btn_insert_post_type_hotel'] == 'SUBMIT HOTEL') || // Skip adding hotel
2992
  (isset($_POST['action']) && $_POST['action'] == 'updraft_savesettings') || // Updraft save settings
2993
  isset($_POST['quform_submit']) || //QForms multi-paged form skip
@@ -3060,7 +3124,7 @@ function ct_contact_form_validate() {
3060
  foreach($_POST as $param => $value){
3061
  if(strpos($param, 'et_pb_contactform_submit') === 0){
3062
  $contact_form = 'contact_form_divi_theme';
3063
- $contact_form_additional = str_replace($param, '', $param);
3064
  }
3065
  if(strpos($param, 'avia_generated_form') === 0){
3066
  $contact_form = 'contact_form_enfold_theme';
@@ -3159,7 +3223,7 @@ function ct_contact_form_validate_postdata() {
3159
  (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3160
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
3161
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
3162
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'/checkout/')!==false ||
3163
  /* WooCommerce Service Requests - skip them */
3164
  isset($_GET['wc-ajax']) && (
3165
  $_GET['wc-ajax']=='checkout' ||
@@ -3175,12 +3239,12 @@ function ct_contact_form_validate_postdata() {
3175
  $_GET['wc-ajax']=='get_customer_location'
3176
  ) ||
3177
  /* END: WooCommerce Service Requests */
3178
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'/wp-admin/')!==false ||
3179
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'wp-login.php')!==false||
3180
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'wp-comments-post.php')!==false ||
3181
- strpos(filter_input(INPUT_SERVER, 'HTTP_REFERER'),'/wp-admin/')!==false ||
3182
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'/login/')!==false||
3183
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'?provider=facebook&')!==false ||
3184
  isset($_GET['ptype']) && $_GET['ptype']=='login' ||
3185
  isset($_POST['ct_checkjs_register_form']) ||
3186
  (isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
@@ -3189,12 +3253,12 @@ function ct_contact_form_validate_postdata() {
3189
  isset($_POST['bbp_reply_content']) ||
3190
  isset($_POST['fscf_submitted']) ||
3191
  isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit'])||
3192
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'/wc-api/')!==false ||
3193
  (isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])) || //WooCommerce recovery password form
3194
  (isset($_POST['woocommerce-login-nonce'], $_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || //WooCommerce login form
3195
  (isset($_POST['provider'], $_POST['authcode']) && $_POST['provider'] == 'Two_Factor_Totp') || //TwoFactor authorization
3196
  (isset($_GET['wc-ajax']) && $_GET['wc-ajax'] == 'sa_wc_buy_now_get_ajax_buy_now_button') || //BuyNow add to cart
3197
- strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'/wp-json/wpstatistics/v1/hit')!==false || //WPStatistics
3198
  (isset($_POST['ihcaction']) && $_POST['ihcaction'] == 'login') || //Skip login form
3199
  (isset($_POST['action']) && $_POST['action'] == 'infinite_scroll') //Scroll
3200
  ) {
@@ -3339,8 +3403,8 @@ function ct_enqueue_scripts_public($hook){
3339
  }
3340
 
3341
  if(!defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') || (defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') && CLEANTALK_AJAX_USE_FOOTER_HEADER)){
3342
- if($apbct->settings['use_ajax'] && stripos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'.xml') === false && stripos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'.xsl') === false){
3343
- if(strpos(filter_input(INPUT_SERVER, 'REQUEST_URI'),'jm-ajax') === false){
3344
 
3345
  // Use AJAX for JavaScript check
3346
  if($apbct->settings['use_ajax']){
254
  add_action( 'um_submit_form_register', 'apbct_registration__UltimateMembers__check', 9, 1 ); // Check submition
255
  }
256
 
257
+ // Paid Memberships Pro integration
258
+ add_filter( 'pmpro_required_user_fields', function( $pmpro_required_user_fields ){
259
+
260
+ if(
261
+ ! empty( $pmpro_required_user_fields['username'] ) &&
262
+ ! empty( $pmpro_required_user_fields['bemail'] ) &&
263
+ ! empty( $pmpro_required_user_fields['bconfirmemail'] ) &&
264
+ $pmpro_required_user_fields['bemail'] == $pmpro_required_user_fields['bconfirmemail']
265
+ ) {
266
+ $check = ct_test_registration( $pmpro_required_user_fields['username'], $pmpro_required_user_fields['bemail'], apbct_http_remote_addr() );
267
+ if( $check['allow'] == 0 ) {
268
+ pmpro_setMessage( $check['comment'], 'pmpro_error' );
269
+ }
270
+ }
271
+
272
+ return $pmpro_required_user_fields;
273
+
274
+ } );
275
+
276
  //
277
  // Load JS code to website footer
278
  //
447
  $message['subject'] = $subject;
448
 
449
  $post_info['comment_type'] = 'feedback_custom_contact_forms';
450
+ $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
451
 
452
  $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
453
  ? apbct_js_test('ct_checkjs', $_COOKIE)
481
  return $args;
482
 
483
  //If the IP is a Google bot
484
+ $hostname = gethostbyaddr( apbct_get_server_variable( 'REMOTE_ADDR' ) );
485
  if(!strpos($hostname, 'googlebot.com'))
486
  return $args;
487
 
495
  $nickname = '';
496
 
497
  $post_info['comment_type'] = 'feedback';
498
+ $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
499
 
500
  $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
501
  ? apbct_js_test('ct_checkjs', $_COOKIE)
551
  'sender_email' => $curr_user->data->user_email,
552
  'sender_nickname' => $curr_user->data->user_login,
553
  'post_info' => array(
554
+ 'post_url' => apbct_get_server_variable( 'HTTP_REFERER' ),
555
  'comment_type' => 'buddypress_activitywall',
556
  ),
557
  'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
645
  'sender_nickname' => $sender_user_obj->data->user_login,
646
  'post_info' => array(
647
  'comment_type' => 'buddypress_comment',
648
+ 'post_url' => apbct_get_server_variable( 'HTTP_REFERER' ),
649
  ),
650
  'js_on' => apbct_js_test('ct_checkjs', $_COOKIE)
651
  ? apbct_js_test('ct_checkjs', $_COOKIE)
742
  $message = array_merge(array('subject' => $subject), $message);
743
 
744
  $post_info['comment_type'] = 'contact_form_wordpress_feedback_pirate';
745
+ $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
746
 
747
  //Making a call
748
  $base_call_result = apbct_base_call(
1152
  $comment['comment_author_email'],
1153
  $comment['comment_author_url'],
1154
  $comment['comment_content'],
1155
+ apbct_get_server_variable( 'REMOTE_ADDR' ),
1156
+ apbct_get_server_variable( 'HTTP_USER_AGENT' )
1157
  );
1158
 
1159
  // Go out if author in local blacklists
1219
  ? null
1220
  : json_encode(array(
1221
  'validation_notice' => $apbct->validation_error,
1222
+ 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
1223
  ))
1224
  ),
1225
  )
1795
  'form_validation' => ! empty( $errors )
1796
  ? json_encode( array(
1797
  'validation_notice' => $errors->get_error_message(),
1798
+ 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
1799
  ) )
1800
  : null,
1801
  );
1982
  * Test for JetPack contact form
1983
  */
1984
  function ct_grunion_contact_form_field_html($r, $field_label) {
1985
+
1986
  global $ct_checkjs_jpcf, $ct_jpcf_patched, $ct_jpcf_fields, $apbct;
1987
+
1988
+ if ($apbct->settings['contact_forms_test'] == 1 && $ct_jpcf_patched === false && preg_match( "/(text|email)/i", $r)) {
 
 
 
1989
 
1990
  // Looking for element name prefix
1991
  $name_patched = false;
2179
  ? null
2180
  : json_encode(array(
2181
  'validation_notice' => $apbct->validation_error,
2182
+ 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
2183
  ))
2184
  ),
2185
  )
2940
 
2941
  }
2942
 
2943
+ function apbct_form__elementor_pro__testSpam() {
2944
+
2945
+ global $apbct, $cleantalk_executed;
2946
+
2947
+ if(
2948
+ $apbct->settings['contact_forms_test'] == 0
2949
+ || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2950
+ || apbct_exclusions_check__url()
2951
+ ){
2952
+ return;
2953
+ }
2954
+
2955
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
2956
+
2957
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2958
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2959
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2960
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2961
+ if ($subject != '') {
2962
+ $message = array_merge(array('subject' => $subject), $message);
2963
+ }
2964
+
2965
+ $post_info['comment_type'] = 'contact_form_wordpress_elementor_pro';
2966
+
2967
+ $cleantalk_executed = true;
2968
+ $base_call_result = apbct_base_call(
2969
+ array(
2970
+ 'message' => $message,
2971
+ 'sender_email' => $sender_email,
2972
+ 'sender_nickname' => $sender_nickname,
2973
+ 'post_info' => $post_info,
2974
+ )
2975
+ );
2976
+
2977
+ $ct_result = $base_call_result['ct_result'];
2978
+
2979
+ if ($ct_result->allow == 0) {
2980
+
2981
+ wp_send_json_error( array(
2982
+ 'message' => $ct_result->comment,
2983
+ 'data' => array()
2984
+ ) );
2985
+
2986
+ }
2987
+
2988
+ }
2989
+
2990
  /**
2991
  * General test for any contact form
2992
  */
3002
  (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3003
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
3004
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
3005
+ apbct_is_in_referer( 'lostpassword' ) ||
3006
+ apbct_is_in_referer( 'lost-password' ) || //Skip lost-password form check
3007
+ (apbct_is_in_uri('/wp-admin/') && (empty($_POST['your-phone']) && empty($_POST['your-email']) && empty($_POST['your-message']))) || //Bitrix24 Contact
3008
+ apbct_is_in_uri('wp-login.php') ||
3009
+ apbct_is_in_uri('wp-comments-post.php') ||
3010
+ apbct_is_in_uri('?provider=facebook&') ||
3011
+ apbct_is_in_uri('reset-password/') || // Ticket #13668. Password reset.
3012
+ apbct_is_in_referer( '/wp-admin/') ||
3013
+ apbct_is_in_uri('/login/') ||
3014
+ apbct_is_in_uri( '/my-account/edit-account/') || // WooCommerce edit account page
3015
+ apbct_is_in_uri( '/my-account/edit-address/') || // WooCommerce edit account page
3016
  (isset($_POST['action']) && $_POST['action'] == 'save_account_details') || // WooCommerce edit account action
3017
+ apbct_is_in_uri( '/peepsoajax/profilefieldsajax.validate_register') ||
3018
  isset($_GET['ptype']) && $_GET['ptype']=='login' ||
3019
  isset($_POST['ct_checkjs_register_form']) ||
3020
  (isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
3022
  isset($_POST['bbp_topic_content']) ||
3023
  isset($_POST['bbp_reply_content']) ||
3024
  isset($_POST['fscf_submitted']) ||
3025
+ apbct_is_in_uri('/wc-api/') ||
3026
  isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit']) ||
3027
  isset($_POST[$ct_checkjs_frm]) && $apbct->settings['contact_forms_test'] == 1 ||// Formidable forms
3028
  isset($_POST['comment_post_ID']) || // The comment form
3034
  (isset($_POST['_wpcf7'], $_POST['_wpcf7_version'], $_POST['_wpcf7_locale'])) || //CF7 fix)
3035
  (isset($_POST['hash'], $_POST['device_unique_id'], $_POST['device_name'])) ||//Mobile Assistant Connector fix
3036
  isset($_POST['gform_submit']) || //Gravity form
3037
+ apbct_is_in_uri( 'wc-ajax=get_refreshed_fragments') ||
3038
  (isset($_POST['ccf_form']) && intval($_POST['ccf_form']) == 1) ||
3039
  (isset($_POST['contact_tags']) && strpos($_POST['contact_tags'], 'MBR:') !== false) ||
3040
+ (apbct_is_in_uri( 'bizuno.php') && !empty($_POST['bizPass'])) ||
3041
+ apbct_is_in_referer( 'my-dashboard/' ) || // ticket_id=7885
3042
  isset($_POST['slm_action'], $_POST['license_key'], $_POST['secret_key'], $_POST['registered_domain']) || // ticket_id=9122
3043
  (isset($_POST['wpforms']['submit']) && $_POST['wpforms']['submit'] == 'wpforms-submit') || // WPForms
3044
  (isset($_POST['action']) && $_POST['action'] == 'grunion-contact-form') || // JetPack
3045
  (isset($_POST['action']) && $_POST['action'] == 'bbp-update-user') || //BBP update user info page
3046
+ apbct_is_in_referer( '?wc-api=WC_Gateway_Transferuj' ) || //WC Gateway
3047
  (isset($_GET['mbr'], $_GET['amp;appname'], $_GET['amp;master'])) || // ticket_id=10773
 
3048
  (isset($_POST['call_function']) && $_POST['call_function'] == 'push_notification_settings') || // Skip mobile requests (push settings)
3049
+ apbct_is_in_uri('membership-login') || // Skip login form
3050
  (isset($_GET['cookie-state-change'])) || //skip GDPR plugin
3051
+ ( apbct_get_server_variable( 'HTTP_USER_AGENT' ) == 'MailChimp' && apbct_is_in_uri( 'mc4wp-sync-api/webhook-listener') ) || // Mailchimp webhook skip
3052
+ apbct_is_in_uri('researcher-log-in') || // Skip login form
3053
+ apbct_is_in_uri('admin_aspcms/_system/AspCms_SiteSetting.asp?action=saves') || // Skip admin save callback
3054
+ apbct_is_in_uri('?profile_tab=postjobs') || // Skip post vacancies
3055
  (isset($_POST['btn_insert_post_type_hotel']) && $_POST['btn_insert_post_type_hotel'] == 'SUBMIT HOTEL') || // Skip adding hotel
3056
  (isset($_POST['action']) && $_POST['action'] == 'updraft_savesettings') || // Updraft save settings
3057
  isset($_POST['quform_submit']) || //QForms multi-paged form skip
3124
  foreach($_POST as $param => $value){
3125
  if(strpos($param, 'et_pb_contactform_submit') === 0){
3126
  $contact_form = 'contact_form_divi_theme';
3127
+ $contact_form_additional = str_replace('et_pb_contactform_submit', '', $param);
3128
  }
3129
  if(strpos($param, 'avia_generated_form') === 0){
3130
  $contact_form = 'contact_form_enfold_theme';
3223
  (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3224
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
3225
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
3226
+ apbct_is_in_uri('/checkout/') ||
3227
  /* WooCommerce Service Requests - skip them */
3228
  isset($_GET['wc-ajax']) && (
3229
  $_GET['wc-ajax']=='checkout' ||
3239
  $_GET['wc-ajax']=='get_customer_location'
3240
  ) ||
3241
  /* END: WooCommerce Service Requests */
3242
+ apbct_is_in_uri('/wp-admin/') ||
3243
+ apbct_is_in_uri('wp-login.php') ||
3244
+ apbct_is_in_uri('wp-comments-post.php') ||
3245
+ apbct_is_in_referer('/wp-admin/') ||
3246
+ apbct_is_in_uri('/login/') ||
3247
+ apbct_is_in_uri('?provider=facebook&') ||
3248
  isset($_GET['ptype']) && $_GET['ptype']=='login' ||
3249
  isset($_POST['ct_checkjs_register_form']) ||
3250
  (isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
3253
  isset($_POST['bbp_reply_content']) ||
3254
  isset($_POST['fscf_submitted']) ||
3255
  isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit'])||
3256
+ apbct_is_in_uri('/wc-api/') ||
3257
  (isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])) || //WooCommerce recovery password form
3258
  (isset($_POST['woocommerce-login-nonce'], $_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || //WooCommerce login form
3259
  (isset($_POST['provider'], $_POST['authcode']) && $_POST['provider'] == 'Two_Factor_Totp') || //TwoFactor authorization
3260
  (isset($_GET['wc-ajax']) && $_GET['wc-ajax'] == 'sa_wc_buy_now_get_ajax_buy_now_button') || //BuyNow add to cart
3261
+ apbct_is_in_uri('/wp-json/wpstatistics/v1/hit') || //WPStatistics
3262
  (isset($_POST['ihcaction']) && $_POST['ihcaction'] == 'login') || //Skip login form
3263
  (isset($_POST['action']) && $_POST['action'] == 'infinite_scroll') //Scroll
3264
  ) {
3403
  }
3404
 
3405
  if(!defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') || (defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') && CLEANTALK_AJAX_USE_FOOTER_HEADER)){
3406
+ if($apbct->settings['use_ajax'] && ! apbct_is_in_uri('.xml') && ! apbct_is_in_uri('.xsl')){
3407
+ if( ! apbct_is_in_uri('jm-ajax') ){
3408
 
3409
  // Use AJAX for JavaScript check
3410
  if($apbct->settings['use_ajax']){
inc/cleantalk-settings.php CHANGED
@@ -1257,7 +1257,7 @@ function apbct_settings__validate($settings) {
1257
  $platform = 'wordpress';
1258
  $user_ip = CleantalkHelper::ip__get(array('real'), false);
1259
  $timezone = filter_input(INPUT_POST, 'ct_admin_timezone');
1260
- $language = filter_input(INPUT_SERVER, 'HTTP_ACCEPT_LANGUAGE');
1261
  $wpms = APBCT_WPMS && defined('SUBDOMAIN_INSTALL') && !SUBDOMAIN_INSTALL ? true : false;
1262
  $white_label = $apbct->network_settings['white_label'] ? 1 : 0;
1263
  $hoster_api_key = $apbct->network_settings['white_label__hoster_key'] ? $apbct->network_settings['white_label__hoster_key'] : '';
1257
  $platform = 'wordpress';
1258
  $user_ip = CleantalkHelper::ip__get(array('real'), false);
1259
  $timezone = filter_input(INPUT_POST, 'ct_admin_timezone');
1260
+ $language = apbct_get_server_variable( 'HTTP_ACCEPT_LANGUAGE' );
1261
  $wpms = APBCT_WPMS && defined('SUBDOMAIN_INSTALL') && !SUBDOMAIN_INSTALL ? true : false;
1262
  $white_label = $apbct->network_settings['white_label'] ? 1 : 0;
1263
  $hoster_api_key = $apbct->network_settings['white_label__hoster_key'] ? $apbct->network_settings['white_label__hoster_key'] : '';
inc/cleantalk-users.php CHANGED
@@ -270,8 +270,8 @@ function ct_show_users_page(){
270
  </div>
271
  <?php
272
  }
273
- echo filter_input(INPUT_SERVER, 'REMOTE_ADDR')=='127.0.0.1' ? '<br /><button class=" ct_to_hide button" id="ct_insert_users">'. __('Insert accounts', 'cleantalk'). ' (100)</button> ' : '';
274
- echo filter_input(INPUT_SERVER, 'REMOTE_ADDR')=='127.0.0.1' ? '<button class="ct_to_hide button" id="ct_delete_users">'. __('Delete accounts', 'cleantalk'). ' (110)</button><br />' : '';
275
 
276
  if($cnt_spam1 > 0){
277
  echo "<div id='ct_search_info'>"
270
  </div>
271
  <?php
272
  }
273
+ echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<br /><button class=" ct_to_hide button" id="ct_insert_users">'. __('Insert accounts', 'cleantalk'). ' (100)</button> ' : '';
274
+ echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<button class="ct_to_hide button" id="ct_delete_users">'. __('Delete accounts', 'cleantalk'). ' (110)</button><br />' : '';
275
 
276
  if($cnt_spam1 > 0){
277
  echo "<div id='ct_search_info'>"
js/apbct-fingerprint.min.js CHANGED
@@ -1,2 +1,2 @@
1
- console.log("some1"),function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define(n):t.Fingerprint=n()}(0,this,function(){"use strict";function e(e){var a,t;a=Array.prototype.forEach,t=Array.prototype.map,this.each=function(e,t,n){if(null!==e)if(a&&e.forEach===a)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e)==={})return}else for(var o in e)if(e.hasOwnProperty(o)&&t.call(n,e[o],o,e)==={})return},this.map=function(e,r,i){var o=[];return null==e?o:t&&e.map===t?e.map(r,i):(this.each(e,function(e,t,n){o[o.length]=r.call(i,e,t,n)}),o)},"object"==typeof e?(this.hasher=e.hasher,this.screen_resolution=e.screen_resolution,this.screen_orientation=e.screen_orientation,this.canvas=e.canvas,this.ie_activex=e.ie_activex):"function"==typeof e&&(this.hasher=e)}return e.prototype={get:function(){var e=[];if(e.push(navigator.userAgent),e.push(navigator.language),e.push(screen.colorDepth),this.screen_resolution){var t=this.getScreenResolution();void 0!==t&&e.push(t.join("x"))}return e.push((new Date).getTimezoneOffset()),e.push(this.hasSessionStorage()),e.push(this.hasLocalStorage()),e.push(this.hasIndexDb()),document.body?e.push(typeof document.body.addBehavior):e.push("undefined"),e.push(typeof window.openDatabase),e.push(navigator.cpuClass),e.push(navigator.platform),e.push(navigator.doNotTrack),e.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&e.push(this.getCanvasFingerprint()),this.hasher?this.hasher(e.join("###"),31):this.murmurhash3_32_gc(e.join("###"),31)},murmurhash3_32_gc:function(e,t){var n,r,i,o,a,s,h,c;for(n=3&e.length,r=e.length-n,i=t,a=3432918353,s=461845907,c=0;c<r;)h=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=h=(65535&(h=(h=(65535&h)*a+(((h>>>16)*a&65535)<<16)&4294967295)<<15|h>>>17))*s+(((h>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(h=0,n){case 3:h^=(255&e.charCodeAt(c+2))<<16;case 2:h^=(255&e.charCodeAt(c+1))<<8;case 1:i^=h=(65535&(h=(h=(65535&(h^=255&e.charCodeAt(c)))*a+(((h>>>16)*a&65535)<<16)&4294967295)<<15|h>>>17))*s+(((h>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(e){return!0}},isCanvasSupported:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(e){var t=this.map(e,function(e){return[e.type,e.suffixes].join("~")}).join(",");return[e.name,e.description,t].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){return this.map(["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"],function(e){try{return new ActiveXObject(e),e}catch(e){return null}}).join(";")}return""},getScreenResolution:function(){return this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n="http://valve.github.io";return t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(n,4,17),e.toDataURL()}},e});
2
  //# sourceMappingURL=apbct-fingerprint.min.js.map
1
+ !function(t,e,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define(n):e.Fingerprint=n()}(0,this,function(){"use strict";function t(t){var o,e;o=Array.prototype.forEach,e=Array.prototype.map,this.each=function(t,e,n){if(null!==t)if(o&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(e.call(n,t[r],r,t)==={})return}else for(var a in t)if(t.hasOwnProperty(a)&&e.call(n,t[a],a,t)==={})return},this.map=function(t,r,i){var a=[];return null==t?a:e&&t.map===e?t.map(r,i):(this.each(t,function(t,e,n){a[a.length]=r.call(i,t,e,n)}),a)},"object"==typeof t?(this.hasher=t.hasher,this.screen_resolution=t.screen_resolution,this.screen_orientation=t.screen_orientation,this.canvas=t.canvas,this.ie_activex=t.ie_activex):"function"==typeof t&&(this.hasher=t)}return t.prototype={get:function(){var t=[];if(t.push(navigator.userAgent),t.push(navigator.language),t.push(screen.colorDepth),this.screen_resolution){var e=this.getScreenResolution();void 0!==e&&t.push(e.join("x"))}return t.push((new Date).getTimezoneOffset()),t.push(this.hasSessionStorage()),t.push(this.hasLocalStorage()),t.push(this.hasIndexDb()),document.body?t.push(typeof document.body.addBehavior):t.push("undefined"),t.push(typeof window.openDatabase),t.push(navigator.cpuClass),t.push(navigator.platform),t.push(navigator.doNotTrack),t.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&t.push(this.getCanvasFingerprint()),this.hasher?this.hasher(t.join("###"),31):this.murmurhash3_32_gc(t.join("###"),31)},murmurhash3_32_gc:function(t,e){var n,r,i,a,o,s,h,c;for(n=3&t.length,r=t.length-n,i=e,o=3432918353,s=461845907,c=0;c<r;)h=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,i=27492+(65535&(a=5*(65535&(i=(i^=h=(65535&(h=(h=(65535&h)*o+(((h>>>16)*o&65535)<<16)&4294967295)<<15|h>>>17))*s+(((h>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(h=0,n){case 3:h^=(255&t.charCodeAt(c+2))<<16;case 2:h^=(255&t.charCodeAt(c+1))<<8;case 1:i^=h=(65535&(h=(h=(65535&(h^=255&t.charCodeAt(c)))*o+(((h>>>16)*o&65535)<<16)&4294967295)<<15|h>>>17))*s+(((h>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(t){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(t){return!0}},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(t){var e=this.map(t,function(t){return[t.type,t.suffixes].join("~")}).join(",");return[t.name,t.description,e].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){return this.map(["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"],function(t){try{return new ActiveXObject(t),t}catch(t){return null}}).join(";")}return""},getScreenResolution:function(){return this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var t=document.createElement("canvas"),e=t.getContext("2d"),n="http://valve.github.io";return e.textBaseline="top",e.font="14px 'Arial'",e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText(n,4,17),t.toDataURL()}},t});
2
  //# sourceMappingURL=apbct-fingerprint.min.js.map
js/apbct-fingerprint.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["apbct-fingerprint.js"],"names":["console","log","name","context","definition","module","exports","define","amd","this","Fingerprint","options","nativeForEach","nativeMap","Array","prototype","forEach","map","each","obj","iterator","length","i","l","call","key","hasOwnProperty","results","value","index","list","hasher","screen_resolution","screen_orientation","canvas","ie_activex","get","keys","push","navigator","userAgent","language","screen","colorDepth","resolution","getScreenResolution","join","Date","getTimezoneOffset","hasSessionStorage","hasLocalStorage","hasIndexDb","document","body","window","cpuClass","platform","doNotTrack","getPluginsString","isCanvasSupported","getCanvasFingerprint","murmurhash3_32_gc","seed","remainder","bytes","h1","h1b","c1","c2","k1","charCodeAt","localStorage","e","sessionStorage","indexedDB","elem","createElement","getContext","isIE","appName","test","getIEPluginsString","getRegularPluginsString","plugins","p","mimeTypes","mt","type","suffixes","description","ActiveXObject","height","width","ctx","txt","textBaseline","font","fillStyle","fillRect","fillText","toDataURL"],"mappings":"AAiBAA,QAAQC,IAAI,SACX,SAAWC,EAAMC,EAASC,GACH,oBAAXC,QAA0BA,OAAOC,QAAWD,OAAOC,QAAUF,IAC7C,mBAAXG,QAAyBA,OAAOC,IAAOD,OAAOH,GACvDD,EAAY,YAAIC,IAHxB,CAIE,EAAeK,KAAM,WACtB,aAEkB,SAAdC,EAAwBC,GAC1B,IAAIC,EAAeC,EACnBD,EAAgBE,MAAMC,UAAUC,QAChCH,EAAYC,MAAMC,UA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AEK,YAAaJ,GAAWvC,KAAK,OAC9CrC,MAAMqC,KAAK,MAGhBmC,mBAAoB,WAClB,GAAG3B,OAAOoC,cAAc,CAiBtB,OAAOjF,KAAKQ,IAhBA,CAAC,gCACX,cACA,cACA,sBAEA,8BACA,gCACA,qDACA,mDACA,aACA,cACA,eACA,sBACA,mBAGqB,SAASf,GAC9B,IAEE,OADA,IAAIwF,cAAcxF,GACXA,EACP,MAAMsE,GACN,OAAO,QAER1B,KAAK,KAER,MAAO,IAIXD,oBAAqB,WAOlB,OALGpC,KAAKwB,mBACQS,OAAOiD,OAASjD,OAAOkD,MAAS,CAAClD,OAAOiD,OAAQjD,OAAOkD,OAAS,CAAClD,OAAOkD,MAAOlD,OAAOiD,QAEvF,CAACjD,OAAOiD,OAAQjD,OAAOkD,QAKzChC,qBAAsB,WACpB,IAAI1B,EAASkB,SAASwB,cAAc,UAChCiB,EAAM3D,EAAO2C,WAAW,MAExBiB,EAAM,yBAUV,OATAD,EAAIE,aAAe,MACnBF,EAAIG,KAAO,eACXH,EAAIE,aAAe,aACnBF,EAAII,UAAY,OAChBJ,EAAIK,SAAS,IAAI,EAAE,GAAG,IACtBL,EAAII,UAAY,OAChBJ,EAAIM,SAASL,EAAK,EAAG,IACrBD,EAAII,UAAY,yBAChBJ,EAAIM,SAASL,EAAK,EAAG,IACd5D,EAAOkE,cAKX1F","file":"apbct-fingerprint.min.js","sourcesContent":["/*\r\n* fingerprintJS 0.5.5 - Fast browser fingerprint library\r\n* https://github.com/Valve/fingerprintjs\r\n* Copyright (c) 2013 Valentin Vasilyev (valentin.vasilyev@outlook.com)\r\n* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\r\n*\r\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r\n* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n*/\r\nconsole.log('some1');\r\n;(function (name, context, definition) {\r\n if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); }\r\n else if (typeof define === 'function' && define.amd) { define(definition); }\r\n else { context[name] = definition(); }\r\n})('Fingerprint', this, function () {\r\n 'use strict';\r\n\r\n var Fingerprint = function (options) {\r\n var nativeForEach, nativeMap;\r\n nativeForEach = Array.prototype.forEach;\r\n nativeMap = Array.prototype.map;\r\n\r\n this.each = function (obj, iterator, context) {\r\n if (obj === null) {\r\n return;\r\n }\r\n if (nativeForEach && obj.forEach === nativeForEach) {\r\n obj.forEach(iterator, context);\r\n } else if (obj.length === +obj.length) {\r\n for (var i = 0, l = obj.length; i < l; i++) {\r\n if (iterator.call(context, obj[i], i, obj) === {}) return;\r\n }\r\n } else {\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n if (iterator.call(context, obj[key], key, obj) === {}) return;\r\n }\r\n }\r\n }\r\n };\r\n\r\n this.map = function(obj, iterator, context) {\r\n var results = [];\r\n // Not using strict equality so that this acts as a\r\n // shortcut to checking for `null` and `undefined`.\r\n if (obj == null) return results;\r\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\r\n this.each(obj, function(value, index, list) {\r\n results[results.length] = iterator.call(context, value, index, list);\r\n });\r\n return results;\r\n };\r\n\r\n if (typeof options == 'object'){\r\n this.hasher = options.hasher;\r\n this.screen_resolution = options.screen_resolution;\r\n this.screen_orientation = options.screen_orientation;\r\n this.canvas = options.canvas;\r\n this.ie_activex = options.ie_activex;\r\n } else if(typeof options == 'function'){\r\n this.hasher = options;\r\n }\r\n };\r\n\r\n Fingerprint.prototype = {\r\n get: function(){\r\n var keys = [];\r\n keys.push(navigator.userAgent);\r\n keys.push(navigator.language);\r\n keys.push(screen.colorDepth);\r\n if (this.screen_resolution) {\r\n var resolution = this.getScreenResolution();\r\n if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs\r\n keys.push(resolution.join('x'));\r\n }\r\n }\r\n keys.push(new Date().getTimezoneOffset());\r\n keys.push(this.hasSessionStorage());\r\n keys.push(this.hasLocalStorage());\r\n keys.push(this.hasIndexDb());\r\n //body might not be defined at this point or removed programmatically\r\n if(document.body){\r\n keys.push(typeof(document.body.addBehavior));\r\n } else {\r\n keys.push(typeof undefined);\r\n }\r\n keys.push(typeof(window.openDatabase));\r\n keys.push(navigator.cpuClass);\r\n keys.push(navigator.platform);\r\n keys.push(navigator.doNotTrack);\r\n keys.push(this.getPluginsString());\r\n if(this.canvas && this.isCanvasSupported()){\r\n keys.push(this.getCanvasFingerprint());\r\n }\r\n if(this.hasher){\r\n return this.hasher(keys.join('###'), 31);\r\n } else {\r\n return this.murmurhash3_32_gc(keys.join('###'), 31);\r\n }\r\n },\r\n\r\n /**\r\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\r\n *\r\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\r\n * @see http://github.com/garycourt/murmurhash-js\r\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\r\n * @see http://sites.google.com/site/murmurhash/\r\n *\r\n * @param {string} key ASCII only\r\n * @param {number} seed Positive integer only\r\n * @return {number} 32-bit positive integer hash\r\n */\r\n\r\n murmurhash3_32_gc: function(key, seed) {\r\n var remainder, bytes, h1, h1b, c1, c2, k1, i;\r\n\r\n remainder = key.length & 3; // key.length % 4\r\n bytes = key.length - remainder;\r\n h1 = seed;\r\n c1 = 0xcc9e2d51;\r\n c2 = 0x1b873593;\r\n i = 0;\r\n\r\n while (i < bytes) {\r\n k1 =\r\n ((key.charCodeAt(i) & 0xff)) |\r\n ((key.charCodeAt(++i) & 0xff) << 8) |\r\n ((key.charCodeAt(++i) & 0xff) << 16) |\r\n ((key.charCodeAt(++i) & 0xff) << 24);\r\n ++i;\r\n\r\n k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\r\n k1 = (k1 << 15) | (k1 >>> 17);\r\n k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\r\n\r\n h1 ^= k1;\r\n h1 = (h1 << 13) | (h1 >>> 19);\r\n h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\r\n h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\r\n }\r\n\r\n k1 = 0;\r\n\r\n switch (remainder) {\r\n case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\r\n case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\r\n case 1: k1 ^= (key.charCodeAt(i) & 0xff);\r\n\r\n k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\r\n k1 = (k1 << 15) | (k1 >>> 17);\r\n k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\r\n h1 ^= k1;\r\n }\r\n\r\n h1 ^= key.length;\r\n\r\n h1 ^= h1 >>> 16;\r\n h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\r\n h1 ^= h1 >>> 13;\r\n h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\r\n h1 ^= h1 >>> 16;\r\n\r\n return h1 >>> 0;\r\n },\r\n\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=781447\r\n hasLocalStorage: function () {\r\n try{\r\n return !!window.localStorage;\r\n } catch(e) {\r\n return true; // SecurityError when referencing it means it exists\r\n }\r\n },\r\n\r\n hasSessionStorage: function () {\r\n try{\r\n return !!window.sessionStorage;\r\n } catch(e) {\r\n return true; // SecurityError when referencing it means it exists\r\n }\r\n },\r\n\r\n hasIndexDb: function () {\r\n try{\r\n return !!window.indexedDB;\r\n } catch(e) {\r\n return true; // SecurityError when referencing it means it exists\r\n }\r\n },\r\n\r\n isCanvasSupported: function () {\r\n var elem = document.createElement('canvas');\r\n return !!(elem.getContext && elem.getContext('2d'));\r\n },\r\n\r\n isIE: function () {\r\n if(navigator.appName === 'Microsoft Internet Explorer') {\r\n return true;\r\n } else if(navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)){// IE 11\r\n return true;\r\n }\r\n return false;\r\n },\r\n\r\n getPluginsString: function () {\r\n if(this.isIE() && this.ie_activex){\r\n return this.getIEPluginsString();\r\n } else {\r\n return this.getRegularPluginsString();\r\n }\r\n },\r\n\r\n getRegularPluginsString: function () {\r\n return this.map(navigator.plugins, function (p) {\r\n var mimeTypes = this.map(p, function(mt){\r\n return [mt.type, mt.suffixes].join('~');\r\n }).join(',');\r\n return [p.name, p.description, mimeTypes].join('::');\r\n }, this).join(';');\r\n },\r\n\r\n getIEPluginsString: function () {\r\n if(window.ActiveXObject){\r\n var names = ['ShockwaveFlash.ShockwaveFlash',//flash plugin\r\n 'AcroPDF.PDF', // Adobe PDF reader 7+\r\n 'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr\r\n 'QuickTime.QuickTime', // QuickTime\r\n // 5 versions of real players\r\n 'rmocx.RealPlayer G2 Control',\r\n 'rmocx.RealPlayer G2 Control.1',\r\n 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)',\r\n 'RealVideo.RealVideo(tm) ActiveX Control (32-bit)',\r\n 'RealPlayer',\r\n 'SWCtl.SWCtl', // ShockWave player\r\n 'WMPlayer.OCX', // Windows media player\r\n 'AgControl.AgControl', // Silverlight\r\n 'Skype.Detection'];\r\n\r\n // starting to detect plugins in IE\r\n return this.map(names, function(name){\r\n try{\r\n new ActiveXObject(name);\r\n return name;\r\n } catch(e){\r\n return null;\r\n }\r\n }).join(';');\r\n } else {\r\n return \"\"; // behavior prior version 0.5.0, not breaking backwards compat.\r\n }\r\n },\r\n\r\n getScreenResolution: function () {\r\n var resolution;\r\n if(this.screen_orientation){\r\n resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height];\r\n }else{\r\n resolution = [screen.height, screen.width];\r\n }\r\n return resolution;\r\n },\r\n\r\n getCanvasFingerprint: function () {\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n // https://www.browserleaks.com/canvas#how-does-it-work\r\n var txt = 'http://valve.github.io';\r\n ctx.textBaseline = \"top\";\r\n ctx.font = \"14px 'Arial'\";\r\n ctx.textBaseline = \"alphabetic\";\r\n ctx.fillStyle = \"#f60\";\r\n ctx.fillRect(125,1,62,20);\r\n ctx.fillStyle = \"#069\";\r\n ctx.fillText(txt, 2, 15);\r\n ctx.fillStyle = \"rgba(102, 204, 0, 0.7)\";\r\n ctx.fillText(txt, 4, 17);\r\n return canvas.toDataURL();\r\n }\r\n };\r\n\r\n\r\n return Fingerprint;\r\n\r\n});"]}
1
+ {"version":3,"sources":["apbct-fingerprint.js"],"names":["name","context","definition","module","exports","define","amd","this","Fingerprint","options","nativeForEach","nativeMap","Array","prototype","forEach","map","each","obj","iterator","length","i","l","call","key","hasOwnProperty","results","value","index","list","hasher","screen_resolution","screen_orientation","canvas","ie_activex","get","keys","push","navigator","userAgent","language","screen","colorDepth","resolution","getScreenResolution","join","Date","getTimezoneOffset","hasSessionStorage","hasLocalStorage","hasIndexDb","document","body","window","cpuClass","platform","doNotTrack","getPluginsString","isCanvasSupported","getCanvasFingerprint","murmurhash3_32_gc","seed","remainder","bytes","h1","h1b","c1","c2","k1","charCodeAt","localStorage","e","sessionStorage","indexedDB","elem","createElement","getContext","isIE","appName","test","getIEPluginsString","getRegularPluginsString","plugins","p","mimeTypes","mt","type","suffixes","description","ActiveXObject","height","width","ctx","txt","textBaseline","font","fillStyle","fillRect","fillText","toDataURL"],"mappings":"CAkBC,SAAWA,EAAMC,EAASC,GACH,oBAAXC,QAA0BA,OAAOC,QAAWD,OAAOC,QAAUF,IAC7C,mBAAXG,QAAyBA,OAAOC,IAAOD,OAAOH,GACvDD,EAAY,YAAIC,IAHxB,CAIE,EAAeK,KAAM,WACtB,aAEkB,SAAdC,EAAwBC,GAC1B,IAAIC,EAAeC,EACnBD,EAAgBE,MAAMC,UAAUC,QAChCH,EAAYC,MAAMC,UAAUE,IAE5BR,KAAKS,KAAO,SAAUC,EAAKC,EAAUjB,GACnC,GAAY,OAARgB,EAGJ,GAAIP,GAAiBO,EAAIH,UAAYJ,EACnCO,EAAIH,QAAQI,EAAUjB,QACjB,GAAIgB,EAAIE,UAAYF,EAAIE,QAC7B,IAAK,IAAIC,EAAI,EAAGC,EAAIJ,EAAIE,OAAQC,EAAIC,EAAGD,IACrC,GAAIF,EAASI,KAAKrB,EAASgB,EAAIG,GAAIA,EAAGH,KAAS,GAAI,YAGrD,IAAK,IAAIM,KAAON,EACd,GAAIA,EAAIO,eAAeD,IACjBL,EAASI,KAAKrB,EAASgB,EAAIM,GAAMA,EAAKN,KAAS,GAAI,QAM/DV,KAAKQ,IAAM,SAASE,EAAKC,EAAUjB,GACjC,IAAIwB,EAAU,GAGd,OAAW,MAAPR,EAAoBQ,EACpBd,GAAaM,E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B,cAAc,UAChCiB,EAAM3D,EAAO2C,WAAW,MAExBiB,EAAM,yBAUV,OATAD,EAAIE,aAAe,MACnBF,EAAIG,KAAO,eACXH,EAAIE,aAAe,aACnBF,EAAII,UAAY,OAChBJ,EAAIK,SAAS,IAAI,EAAE,GAAG,IACtBL,EAAII,UAAY,OAChBJ,EAAIM,SAASL,EAAK,EAAG,IACrBD,EAAII,UAAY,yBAChBJ,EAAIM,SAASL,EAAK,EAAG,IACd5D,EAAOkE,cAKX1F","file":"apbct-fingerprint.min.js","sourcesContent":["/*\r\n* fingerprintJS 0.5.5 - Fast browser fingerprint library\r\n* https://github.com/Valve/fingerprintjs\r\n* Copyright (c) 2013 Valentin Vasilyev (valentin.vasilyev@outlook.com)\r\n* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\r\n*\r\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r\n* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n*/\r\n\r\n;(function (name, context, definition) {\r\n if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); }\r\n else if (typeof define === 'function' && define.amd) { define(definition); }\r\n else { context[name] = definition(); }\r\n})('Fingerprint', this, function () {\r\n 'use strict';\r\n\r\n var Fingerprint = function (options) {\r\n var nativeForEach, nativeMap;\r\n nativeForEach = Array.prototype.forEach;\r\n nativeMap = Array.prototype.map;\r\n\r\n this.each = function (obj, iterator, context) {\r\n if (obj === null) {\r\n return;\r\n }\r\n if (nativeForEach && obj.forEach === nativeForEach) {\r\n obj.forEach(iterator, context);\r\n } else if (obj.length === +obj.length) {\r\n for (var i = 0, l = obj.length; i < l; i++) {\r\n if (iterator.call(context, obj[i], i, obj) === {}) return;\r\n }\r\n } else {\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n if (iterator.call(context, obj[key], key, obj) === {}) return;\r\n }\r\n }\r\n }\r\n };\r\n\r\n this.map = function(obj, iterator, context) {\r\n var results = [];\r\n // Not using strict equality so that this acts as a\r\n // shortcut to checking for `null` and `undefined`.\r\n if (obj == null) return results;\r\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\r\n this.each(obj, function(value, index, list) {\r\n results[results.length] = iterator.call(context, value, index, list);\r\n });\r\n return results;\r\n };\r\n\r\n if (typeof options == 'object'){\r\n this.hasher = options.hasher;\r\n this.screen_resolution = options.screen_resolution;\r\n this.screen_orientation = options.screen_orientation;\r\n this.canvas = options.canvas;\r\n this.ie_activex = options.ie_activex;\r\n } else if(typeof options == 'function'){\r\n this.hasher = options;\r\n }\r\n };\r\n\r\n Fingerprint.prototype = {\r\n get: function(){\r\n var keys = [];\r\n keys.push(navigator.userAgent);\r\n keys.push(navigator.language);\r\n keys.push(screen.colorDepth);\r\n if (this.screen_resolution) {\r\n var resolution = this.getScreenResolution();\r\n if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs\r\n keys.push(resolution.join('x'));\r\n }\r\n }\r\n keys.push(new Date().getTimezoneOffset());\r\n keys.push(this.hasSessionStorage());\r\n keys.push(this.hasLocalStorage());\r\n keys.push(this.hasIndexDb());\r\n //body might not be defined at this point or removed programmatically\r\n if(document.body){\r\n keys.push(typeof(document.body.addBehavior));\r\n } else {\r\n keys.push(typeof undefined);\r\n }\r\n keys.push(typeof(window.openDatabase));\r\n keys.push(navigator.cpuClass);\r\n keys.push(navigator.platform);\r\n keys.push(navigator.doNotTrack);\r\n keys.push(this.getPluginsString());\r\n if(this.canvas && this.isCanvasSupported()){\r\n keys.push(this.getCanvasFingerprint());\r\n }\r\n if(this.hasher){\r\n return this.hasher(keys.join('###'), 31);\r\n } else {\r\n return this.murmurhash3_32_gc(keys.join('###'), 31);\r\n }\r\n },\r\n\r\n /**\r\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\r\n *\r\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\r\n * @see http://github.com/garycourt/murmurhash-js\r\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\r\n * @see http://sites.google.com/site/murmurhash/\r\n *\r\n * @param {string} key ASCII only\r\n * @param {number} seed Positive integer only\r\n * @return {number} 32-bit positive integer hash\r\n */\r\n\r\n murmurhash3_32_gc: function(key, seed) {\r\n var remainder, bytes, h1, h1b, c1, c2, k1, i;\r\n\r\n remainder = key.length & 3; // key.length % 4\r\n bytes = key.length - remainder;\r\n h1 = seed;\r\n c1 = 0xcc9e2d51;\r\n c2 = 0x1b873593;\r\n i = 0;\r\n\r\n while (i < bytes) {\r\n k1 =\r\n ((key.charCodeAt(i) & 0xff)) |\r\n ((key.charCodeAt(++i) & 0xff) << 8) |\r\n ((key.charCodeAt(++i) & 0xff) << 16) |\r\n ((key.charCodeAt(++i) & 0xff) << 24);\r\n ++i;\r\n\r\n k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\r\n k1 = (k1 << 15) | (k1 >>> 17);\r\n k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\r\n\r\n h1 ^= k1;\r\n h1 = (h1 << 13) | (h1 >>> 19);\r\n h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\r\n h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\r\n }\r\n\r\n k1 = 0;\r\n\r\n switch (remainder) {\r\n case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\r\n case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\r\n case 1: k1 ^= (key.charCodeAt(i) & 0xff);\r\n\r\n k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\r\n k1 = (k1 << 15) | (k1 >>> 17);\r\n k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\r\n h1 ^= k1;\r\n }\r\n\r\n h1 ^= key.length;\r\n\r\n h1 ^= h1 >>> 16;\r\n h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\r\n h1 ^= h1 >>> 13;\r\n h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\r\n h1 ^= h1 >>> 16;\r\n\r\n return h1 >>> 0;\r\n },\r\n\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=781447\r\n hasLocalStorage: function () {\r\n try{\r\n return !!window.localStorage;\r\n } catch(e) {\r\n return true; // SecurityError when referencing it means it exists\r\n }\r\n },\r\n\r\n hasSessionStorage: function () {\r\n try{\r\n return !!window.sessionStorage;\r\n } catch(e) {\r\n return true; // SecurityError when referencing it means it exists\r\n }\r\n },\r\n\r\n hasIndexDb: function () {\r\n try{\r\n return !!window.indexedDB;\r\n } catch(e) {\r\n return true; // SecurityError when referencing it means it exists\r\n }\r\n },\r\n\r\n isCanvasSupported: function () {\r\n var elem = document.createElement('canvas');\r\n return !!(elem.getContext && elem.getContext('2d'));\r\n },\r\n\r\n isIE: function () {\r\n if(navigator.appName === 'Microsoft Internet Explorer') {\r\n return true;\r\n } else if(navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)){// IE 11\r\n return true;\r\n }\r\n return false;\r\n },\r\n\r\n getPluginsString: function () {\r\n if(this.isIE() && this.ie_activex){\r\n return this.getIEPluginsString();\r\n } else {\r\n return this.getRegularPluginsString();\r\n }\r\n },\r\n\r\n getRegularPluginsString: function () {\r\n return this.map(navigator.plugins, function (p) {\r\n var mimeTypes = this.map(p, function(mt){\r\n return [mt.type, mt.suffixes].join('~');\r\n }).join(',');\r\n return [p.name, p.description, mimeTypes].join('::');\r\n }, this).join(';');\r\n },\r\n\r\n getIEPluginsString: function () {\r\n if(window.ActiveXObject){\r\n var names = ['ShockwaveFlash.ShockwaveFlash',//flash plugin\r\n 'AcroPDF.PDF', // Adobe PDF reader 7+\r\n 'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr\r\n 'QuickTime.QuickTime', // QuickTime\r\n // 5 versions of real players\r\n 'rmocx.RealPlayer G2 Control',\r\n 'rmocx.RealPlayer G2 Control.1',\r\n 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)',\r\n 'RealVideo.RealVideo(tm) ActiveX Control (32-bit)',\r\n 'RealPlayer',\r\n 'SWCtl.SWCtl', // ShockWave player\r\n 'WMPlayer.OCX', // Windows media player\r\n 'AgControl.AgControl', // Silverlight\r\n 'Skype.Detection'];\r\n\r\n // starting to detect plugins in IE\r\n return this.map(names, function(name){\r\n try{\r\n new ActiveXObject(name);\r\n return name;\r\n } catch(e){\r\n return null;\r\n }\r\n }).join(';');\r\n } else {\r\n return \"\"; // behavior prior version 0.5.0, not breaking backwards compat.\r\n }\r\n },\r\n\r\n getScreenResolution: function () {\r\n var resolution;\r\n if(this.screen_orientation){\r\n resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height];\r\n }else{\r\n resolution = [screen.height, screen.width];\r\n }\r\n return resolution;\r\n },\r\n\r\n getCanvasFingerprint: function () {\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n // https://www.browserleaks.com/canvas#how-does-it-work\r\n var txt = 'http://valve.github.io';\r\n ctx.textBaseline = \"top\";\r\n ctx.font = \"14px 'Arial'\";\r\n ctx.textBaseline = \"alphabetic\";\r\n ctx.fillStyle = \"#f60\";\r\n ctx.fillRect(125,1,62,20);\r\n ctx.fillStyle = \"#069\";\r\n ctx.fillText(txt, 2, 15);\r\n ctx.fillStyle = \"rgba(102, 204, 0, 0.7)\";\r\n ctx.fillText(txt, 4, 17);\r\n return canvas.toDataURL();\r\n }\r\n };\r\n\r\n\r\n return Fingerprint;\r\n\r\n});"]}
lib/Cleantalk/Antispam/API.php CHANGED
@@ -135,18 +135,25 @@ class API
135
  *
136
  * @param string $api_key API key
137
  * @param string $path_to_cms Website URL
 
138
  * @param bool $do_check
139
  *
140
  * @return array|bool|mixed
141
  */
142
- static public function method__notice_paid_till($api_key, $path_to_cms, $do_check = true)
143
  {
144
  $request = array(
145
- 'method_name' => 'notice_paid_till',
146
- 'path_to_cms' => $path_to_cms,
147
- 'auth_key' => $api_key
148
  );
149
 
 
 
 
 
 
 
150
  $result = static::send_request($request);
151
  $result = $do_check ? static::check_response($result, 'notice_paid_till') : $result;
152
 
135
  *
136
  * @param string $api_key API key
137
  * @param string $path_to_cms Website URL
138
+ * @param string $product_name
139
  * @param bool $do_check
140
  *
141
  * @return array|bool|mixed
142
  */
143
+ static public function method__notice_paid_till($api_key, $path_to_cms, $product_name = 'antispam', $do_check = true)
144
  {
145
  $request = array(
146
+ 'method_name' => 'notice_paid_till',
147
+ 'path_to_cms' => $path_to_cms,
148
+ 'auth_key' => $api_key,
149
  );
150
 
151
+ $product_id = null;
152
+ $product_id = $product_name == 'antispam' ? 1 : $product_id;
153
+ $product_id = $product_name == 'security' ? 4 : $product_id;
154
+ if($product_id)
155
+ $request['product_id'] = $product_id;
156
+
157
  $result = static::send_request($request);
158
  $result = $do_check ? static::check_response($result, 'notice_paid_till') : $result;
159
 
lib/CleantalkSFW.php CHANGED
@@ -67,7 +67,7 @@ class CleantalkSFW extends Cleantalk\Antispam\SFW
67
  $sfw_die_page = file_get_contents(CLEANTALK_PLUGIN_DIR . "inc/sfw_die_page.html");
68
 
69
  // Translation
70
- $request_uri = filter_input(INPUT_SERVER, 'REQUEST_URI');
71
  $sfw_die_page = str_replace('{SFW_DIE_NOTICE_IP}', __('SpamFireWall is activated for your IP ', 'cleantalk'), $sfw_die_page);
72
  $sfw_die_page = str_replace('{SFW_DIE_MAKE_SURE_JS_ENABLED}', __('To continue working with web site, please make sure that you have enabled JavaScript.', 'cleantalk'), $sfw_die_page);
73
  $sfw_die_page = str_replace('{SFW_DIE_CLICK_TO_PASS}', __('Please click below to pass protection,', 'cleantalk'), $sfw_die_page);
@@ -98,7 +98,7 @@ class CleantalkSFW extends Cleantalk\Antispam\SFW
98
  $sfw_die_page = str_replace('{COOKIE_PREFIX}', $cookie_prefix, $sfw_die_page);
99
  $sfw_die_page = str_replace('{COOKIE_DOMAIN}', $cookie_domain, $sfw_die_page);
100
  $sfw_die_page = str_replace('{SERVICE_ID}', $apbct->data['service_id'], $sfw_die_page);
101
- $sfw_die_page = str_replace('{HOST}', filter_input(INPUT_SERVER, 'HTTP_HOST'), $sfw_die_page);
102
 
103
  $sfw_die_page = str_replace(
104
  '{SFW_COOKIE}',
@@ -118,9 +118,9 @@ class CleantalkSFW extends Cleantalk\Antispam\SFW
118
  . '<h1>Headers</h1>'
119
  . var_export(apache_request_headers(), true)
120
  . '<h1>REMOTE_ADDR</h1>'
121
- . var_export(filter_input(INPUT_SERVER, 'REMOTE_ADDR'), true)
122
  . '<h1>SERVER_ADDR</h1>'
123
- . var_export(filter_input(INPUT_SERVER, 'REMOTE_ADDR'), true)
124
  . '<h1>IP_ARRAY</h1>'
125
  . var_export($this->ip_array, true)
126
  . '<h1>ADDITIONAL</h1>'
67
  $sfw_die_page = file_get_contents(CLEANTALK_PLUGIN_DIR . "inc/sfw_die_page.html");
68
 
69
  // Translation
70
+ $request_uri = apbct_get_server_variable( 'REQUEST_URI' );
71
  $sfw_die_page = str_replace('{SFW_DIE_NOTICE_IP}', __('SpamFireWall is activated for your IP ', 'cleantalk'), $sfw_die_page);
72
  $sfw_die_page = str_replace('{SFW_DIE_MAKE_SURE_JS_ENABLED}', __('To continue working with web site, please make sure that you have enabled JavaScript.', 'cleantalk'), $sfw_die_page);
73
  $sfw_die_page = str_replace('{SFW_DIE_CLICK_TO_PASS}', __('Please click below to pass protection,', 'cleantalk'), $sfw_die_page);
98
  $sfw_die_page = str_replace('{COOKIE_PREFIX}', $cookie_prefix, $sfw_die_page);
99
  $sfw_die_page = str_replace('{COOKIE_DOMAIN}', $cookie_domain, $sfw_die_page);
100
  $sfw_die_page = str_replace('{SERVICE_ID}', $apbct->data['service_id'], $sfw_die_page);
101
+ $sfw_die_page = str_replace('{HOST}', apbct_get_server_variable( 'HTTP_HOST' ), $sfw_die_page);
102
 
103
  $sfw_die_page = str_replace(
104
  '{SFW_COOKIE}',
118
  . '<h1>Headers</h1>'
119
  . var_export(apache_request_headers(), true)
120
  . '<h1>REMOTE_ADDR</h1>'
121
+ . var_export(apbct_get_server_variable( 'REMOTE_ADDR' ), true)
122
  . '<h1>SERVER_ADDR</h1>'
123
+ . var_export(apbct_get_server_variable( 'REMOTE_ADDR' ), true)
124
  . '<h1>IP_ARRAY</h1>'
125
  . var_export($this->ip_array, true)
126
  . '<h1>ADDITIONAL</h1>'
lib/CleantalkState.php CHANGED
@@ -537,4 +537,20 @@ class CleantalkState
537
  {
538
  unset($this->storage[$name]);
539
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
540
  }
537
  {
538
  unset($this->storage[$name]);
539
  }
540
+
541
+ public function server(){
542
+ return \Cleantalk\Common\Server::getInstance();
543
+ }
544
+ public function cookie(){
545
+ return \Cleantalk\Common\Cookie::getInstance();
546
+ }
547
+ public function request(){
548
+ return \Cleantalk\Common\Request::getInstance();
549
+ }
550
+ public function post(){
551
+ return \Cleantalk\Common\Post::getInstance();
552
+ }
553
+ public function get(){
554
+ return \Cleantalk\Common\Get::getInstance();
555
+ }
556
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: safronik
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.3
6
- Stable tag: 5.129.1
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -566,6 +566,15 @@ If your website has forms that send data to external sources, you can enable opt
566
  10. Website's options.
567
 
568
  == Changelog ==
 
 
 
 
 
 
 
 
 
569
  = 5.129.1 November 5 2019 =
570
  * Fix: WooCommerce order detecting.
571
 
@@ -2037,6 +2046,15 @@ If your website has forms that send data to external sources, you can enable opt
2037
  * First version
2038
 
2039
  == Upgrade Notice ==
 
 
 
 
 
 
 
 
 
2040
  = 5.129.1 November 5 2019 =
2041
  * Fix: WooCommerce order detecting.
2042
 
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.3
6
+ Stable tag: 5.130
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
566
  10. Website's options.
567
 
568
  == Changelog ==
569
+ = 5.130 November 14 2019 =
570
+ * Fix: JetPack contact form JS check.
571
+ * FIx: Iphorm AJAX form.
572
+ * Fix: Paid Memberships Pro fix.
573
+ * Fix: Divi theme contact form fix.
574
+ * Integration: Paid Memberships Pro.
575
+ * Integration: Elementor Pro page builder forms.
576
+ * Improved: Compatibility with different server.
577
+
578
  = 5.129.1 November 5 2019 =
579
  * Fix: WooCommerce order detecting.
580
 
2046
  * First version
2047
 
2048
  == Upgrade Notice ==
2049
+ = 5.130 November 14 2019 =
2050
+ * Fix: JetPack contact form JS check.
2051
+ * FIx: Iphorm AJAX form.
2052
+ * Fix: Paid Memberships Pro fix.
2053
+ * Fix: Divi theme contact form fix.
2054
+ * Integration: Paid Memberships Pro.
2055
+ * Integration: Elementor Pro page builder forms.
2056
+ * Improved: Compatibility with different server.
2057
+
2058
  = 5.129.1 November 5 2019 =
2059
  * Fix: WooCommerce order detecting.
2060