Version Description
Download this release
Release Info
Developer | shagimuratov |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.28-debug |
Comparing to | |
See all releases |
Code changes from version 5.28 to 5.28-debug
- cleantalk.php +8 -38
- cleantalk_nocache.js +133 -0
- inc/cleantalk-admin.php +1 -1
- inc/cleantalk-admin_old.php +1 -1
- inc/cleantalk-comments.php +1 -1
- inc/cleantalk-common.php +21 -3
- inc/cleantalk-public.php +68 -54
- inc/cleantalk-users.php +1 -1
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
cleantalk.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name: Anti-
|
4 |
Plugin URI: http://cleantalk.org
|
5 |
Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
-
Version: 5.28
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
-
$cleantalk_plugin_version='5.28';
|
11 |
$cleantalk_executed=false;
|
12 |
|
13 |
if(defined('CLEANTALK_AJAX_USE_BUFFER'))
|
@@ -74,17 +74,6 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
74 |
}
|
75 |
}
|
76 |
|
77 |
-
$jigo_version=@get_option('jigoshop_db_version', '');
|
78 |
-
if($jigo_version=='')
|
79 |
-
{
|
80 |
-
ct_init_session();
|
81 |
-
}
|
82 |
-
|
83 |
-
if(!isset($_SESSION['ct_redirects']))
|
84 |
-
{
|
85 |
-
$_SESSION['ct_redirects']=0;
|
86 |
-
}
|
87 |
-
|
88 |
if(isset($ct_options['check_external']))
|
89 |
{
|
90 |
if(@intval($ct_options['check_external'])==1)
|
@@ -105,13 +94,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
105 |
// http://codex.wordpress.org/Function_Reference/register_activation_hook
|
106 |
register_activation_hook( __FILE__, 'ct_activation' );
|
107 |
register_deactivation_hook( __FILE__, 'ct_deactivation' );
|
108 |
-
if(!defined('WP_ALLOW_MULTISITE')||defined('WP_ALLOW_MULTISITE')&&WP_ALLOW_MULTISITE==false)
|
109 |
-
{
|
110 |
-
add_action('admin_init', 'ct_plugin_redirect');
|
111 |
-
}
|
112 |
|
113 |
-
|
114 |
-
|
115 |
// After plugin loaded - to load locale as described in manual
|
116 |
add_action( 'plugins_loaded', 'ct_plugin_loaded' );
|
117 |
|
@@ -186,7 +169,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
186 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
187 |
|
188 |
// Init action.
|
189 |
-
|
190 |
add_action('plugins_loaded', 'ct_init', 1);
|
191 |
|
192 |
// Hourly run hook
|
@@ -208,6 +191,9 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
208 |
// Login form - for notifications only
|
209 |
add_filter('login_message', 'ct_login_message');
|
210 |
}
|
|
|
|
|
|
|
211 |
}
|
212 |
|
213 |
/**
|
@@ -234,22 +220,6 @@ if (!function_exists ( 'ct_deactivation')) {
|
|
234 |
}
|
235 |
}
|
236 |
|
237 |
-
/**
|
238 |
-
* Uses for redirection after activation
|
239 |
-
*/
|
240 |
-
function ct_plugin_redirect()
|
241 |
-
{
|
242 |
-
if (get_option('ct_plugin_do_activation_redirect', false))
|
243 |
-
{
|
244 |
-
delete_option('ct_plugin_do_activation_redirect');
|
245 |
-
if(!isset($_GET['activate-multi'])&&@intval($_SESSION['ct_redirects'])==0)
|
246 |
-
{
|
247 |
-
$_SESSION['ct_redirects']=1;
|
248 |
-
wp_redirect("options-general.php?page=cleantalk");
|
249 |
-
}
|
250 |
-
}
|
251 |
-
}
|
252 |
-
|
253 |
function ct_add_event($event_type)
|
254 |
{
|
255 |
global $ct_data,$cleantalk_executed;
|
@@ -455,4 +425,4 @@ function ct_send_sfw_log()
|
|
455 |
$sfw = new CleanTalkSFW();
|
456 |
$sfw->send_logs();
|
457 |
}
|
458 |
-
?>
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: http://cleantalk.org
|
5 |
Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
+
Version: 5.28.5
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
+
$cleantalk_plugin_version='5.28.5';
|
11 |
$cleantalk_executed=false;
|
12 |
|
13 |
if(defined('CLEANTALK_AJAX_USE_BUFFER'))
|
74 |
}
|
75 |
}
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
if(isset($ct_options['check_external']))
|
78 |
{
|
79 |
if(@intval($ct_options['check_external'])==1)
|
94 |
// http://codex.wordpress.org/Function_Reference/register_activation_hook
|
95 |
register_activation_hook( __FILE__, 'ct_activation' );
|
96 |
register_deactivation_hook( __FILE__, 'ct_deactivation' );
|
|
|
|
|
|
|
|
|
97 |
|
|
|
|
|
98 |
// After plugin loaded - to load locale as described in manual
|
99 |
add_action( 'plugins_loaded', 'ct_plugin_loaded' );
|
100 |
|
169 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
170 |
|
171 |
// Init action.
|
172 |
+
add_action('init', 'ct_init_after_all', 100);
|
173 |
add_action('plugins_loaded', 'ct_init', 1);
|
174 |
|
175 |
// Hourly run hook
|
191 |
// Login form - for notifications only
|
192 |
add_filter('login_message', 'ct_login_message');
|
193 |
}
|
194 |
+
|
195 |
+
add_action('wp_logout', 'ct_end_session');
|
196 |
+
add_action('wp_login', 'ct_end_session');
|
197 |
}
|
198 |
|
199 |
/**
|
220 |
}
|
221 |
}
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
function ct_add_event($event_type)
|
224 |
{
|
225 |
global $ct_data,$cleantalk_executed;
|
425 |
$sfw = new CleanTalkSFW();
|
426 |
$sfw->send_logs();
|
427 |
}
|
428 |
+
?>
|
cleantalk_nocache.js
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function sendRequest(url,callback,postData) {
|
2 |
+
var req = createXMLHTTPObject();
|
3 |
+
if (!req) return;
|
4 |
+
var method = (postData) ? "POST" : "GET";
|
5 |
+
req.open(method,url,true);
|
6 |
+
if (postData)
|
7 |
+
req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
|
8 |
+
req.onreadystatechange = function () {
|
9 |
+
if (req.readyState != 4) return;
|
10 |
+
if (req.status != 200 && req.status != 304) {
|
11 |
+
// alert('HTTP error ' + req.status);
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
callback(req);
|
15 |
+
};
|
16 |
+
if (req.readyState == 4) return;
|
17 |
+
req.send(postData);
|
18 |
+
}
|
19 |
+
|
20 |
+
var XMLHttpFactories = [
|
21 |
+
function () {return new XMLHttpRequest()},
|
22 |
+
function () {return new ActiveXObject("Msxml2.XMLHTTP")},
|
23 |
+
function () {return new ActiveXObject("Msxml3.XMLHTTP")},
|
24 |
+
function () {return new ActiveXObject("Microsoft.XMLHTTP")}
|
25 |
+
];
|
26 |
+
|
27 |
+
function createXMLHTTPObject() {
|
28 |
+
var xmlhttp = false;
|
29 |
+
for (var i=0;i<XMLHttpFactories.length;i++) {
|
30 |
+
try {
|
31 |
+
xmlhttp = XMLHttpFactories[i]();
|
32 |
+
}
|
33 |
+
catch (e) {
|
34 |
+
continue;
|
35 |
+
}
|
36 |
+
break;
|
37 |
+
}
|
38 |
+
return xmlhttp;
|
39 |
+
}
|
40 |
+
|
41 |
+
function ct_getCookie(name) {
|
42 |
+
var matches = document.cookie.match(new RegExp(
|
43 |
+
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
44 |
+
));
|
45 |
+
return matches ? decodeURIComponent(matches[1]) : undefined;
|
46 |
+
}
|
47 |
+
|
48 |
+
function ct_setCookie(name, value)
|
49 |
+
{
|
50 |
+
/*var domain=location.hostname;
|
51 |
+
tmp=domain.split('.');
|
52 |
+
if(tmp[0].toLowerCase()=='www')
|
53 |
+
{
|
54 |
+
tmp[0]='';
|
55 |
+
}
|
56 |
+
else
|
57 |
+
{
|
58 |
+
tmp[0]='.'+tmp[0];
|
59 |
+
}
|
60 |
+
domain=tmp.join('.');*/
|
61 |
+
|
62 |
+
document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /";
|
63 |
+
document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT";
|
64 |
+
//document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /; domain = " + domain;
|
65 |
+
|
66 |
+
var date = new Date;
|
67 |
+
date.setDate(date.getDate() + 1);
|
68 |
+
//setTimeout(function() { document.cookie = name+"=" + value + "; expires=" + date.toUTCString() + "; path = /; domain = " + domain}, 500)
|
69 |
+
setTimeout(function() { document.cookie = name+"=" + value + "; expires=" + date.toUTCString() + "; path = /;"}, 500);
|
70 |
+
//document.cookie = name+"=" + value + "; expires=" + date.toUTCString() + "; path = /;";
|
71 |
+
}
|
72 |
+
|
73 |
+
function ct_callback(req)
|
74 |
+
{
|
75 |
+
ct_cookie=req.responseText.trim();
|
76 |
+
//alert('Key value: ' + ct_cookie);
|
77 |
+
|
78 |
+
ct_setCookie('ct_checkjs', ct_cookie);
|
79 |
+
|
80 |
+
for(i=0;i<document.forms.length;i++)
|
81 |
+
{
|
82 |
+
f=document.forms[i];
|
83 |
+
for(j=0;j<f.elements.length;j++)
|
84 |
+
{
|
85 |
+
e=f.elements[j];
|
86 |
+
if(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)
|
87 |
+
{
|
88 |
+
e.value=ct_cookie;
|
89 |
+
//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
//alert('Set cookie: \n' + document.cookie);
|
95 |
+
}
|
96 |
+
|
97 |
+
if (!Date.now) {
|
98 |
+
Date.now = function() { return new Date().getTime(); }
|
99 |
+
}
|
100 |
+
|
101 |
+
if(ct_nocache_executed==undefined)
|
102 |
+
{
|
103 |
+
var ct_nocache_executed=true;
|
104 |
+
var new_timestamp=Math.floor(Date.now() / 1000);
|
105 |
+
|
106 |
+
var old_timestamp=ct_getCookie('ct_timestamp');
|
107 |
+
|
108 |
+
var checkjs_cookie=ct_getCookie('ct_checkjs');
|
109 |
+
|
110 |
+
if(checkjs_cookie!=undefined)
|
111 |
+
{
|
112 |
+
for(i=0;i<document.forms.length;i++)
|
113 |
+
{
|
114 |
+
f=document.forms[i];
|
115 |
+
for(j=0;j<f.elements.length;j++)
|
116 |
+
{
|
117 |
+
e=f.elements[j];
|
118 |
+
if(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)
|
119 |
+
{
|
120 |
+
e.value=checkjs_cookie;
|
121 |
+
//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
if(old_timestamp==undefined||new_timestamp-old_timestamp>86400||checkjs_cookie==undefined) //86400 is 24 hours
|
128 |
+
{
|
129 |
+
ct_setCookie('ct_timestamp', new_timestamp);
|
130 |
+
//alert('set!');
|
131 |
+
sendRequest(ct_ajaxurl+'?'+Math.random(),ct_callback,'action=ct_get_cookie');
|
132 |
+
}
|
133 |
+
}
|
inc/cleantalk-admin.php
CHANGED
@@ -1217,4 +1217,4 @@ function ct_unmark_red($message) {
|
|
1217 |
return $message;
|
1218 |
}
|
1219 |
|
1220 |
-
?>
|
1217 |
return $message;
|
1218 |
}
|
1219 |
|
1220 |
+
?>
|
inc/cleantalk-admin_old.php
CHANGED
@@ -1216,4 +1216,4 @@ function ct_unmark_red($message) {
|
|
1216 |
return $message;
|
1217 |
}
|
1218 |
|
1219 |
-
?>
|
1216 |
return $message;
|
1217 |
}
|
1218 |
|
1219 |
+
?>
|
inc/cleantalk-comments.php
CHANGED
@@ -473,4 +473,4 @@ function ct_ajax_clear_comments()
|
|
473 |
$wpdb->query("delete from $wpdb->commentmeta where meta_key='ct_hash' or meta_key='ct_checked' or meta_key='ct_marked_as_spam';");
|
474 |
die();
|
475 |
}
|
476 |
-
?>
|
473 |
$wpdb->query("delete from $wpdb->commentmeta where meta_key='ct_hash' or meta_key='ct_checked' or meta_key='ct_marked_as_spam';");
|
474 |
die();
|
475 |
}
|
476 |
+
?>
|
inc/cleantalk-common.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$ct_agent_version = 'wordpress-
|
4 |
$ct_plugin_name = 'Anti-spam by CleanTalk';
|
5 |
$ct_checkjs_frm = 'ct_checkjs_frm';
|
6 |
$ct_checkjs_register_form = 'ct_checkjs_register_form';
|
@@ -109,13 +109,23 @@ function ct_plugin_loaded() {
|
|
109 |
* @return null;
|
110 |
*/
|
111 |
function ct_init_session() {
|
112 |
-
|
113 |
-
|
|
|
114 |
}
|
115 |
|
116 |
return null;
|
117 |
}
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
/**
|
120 |
* Inner function - Common part of request sending
|
121 |
* @param array Array of parameters:
|
@@ -252,6 +262,8 @@ function ct_base_call($params = array()) {
|
|
252 |
|
253 |
// Restart submit form counter for failed requests
|
254 |
if ($ct_result->allow == 0) {
|
|
|
|
|
255 |
@header("CtBaseCall: result not allow");
|
256 |
$_SESSION[$ct_formtime_label] = time();
|
257 |
if(!isset($ct_result->errno)||isset($ct_result->errno)&&$ct_result->errno!=0)
|
@@ -282,6 +294,8 @@ function ct_base_call($params = array()) {
|
|
282 |
*/
|
283 |
function submit_time_test() {
|
284 |
global $ct_formtime_label;
|
|
|
|
|
285 |
|
286 |
$submit_time = null;
|
287 |
if (isset($_SESSION[$ct_formtime_label])) {
|
@@ -545,6 +559,8 @@ function ct_feedback($hash, $message = null, $allow) {
|
|
545 |
if ($message !== null) {
|
546 |
$resultMessage = $ct->delCleantalkComment($message);
|
547 |
}
|
|
|
|
|
548 |
|
549 |
$ct_feedback = $hash . ':' . $allow . ';';
|
550 |
if (empty($_SESSION['feedback_request'])) {
|
@@ -566,6 +582,8 @@ function ct_send_feedback($feedback_request = null) {
|
|
566 |
|
567 |
$ct_options = ct_get_options();
|
568 |
$ct_data = ct_get_data();
|
|
|
|
|
569 |
|
570 |
if (empty($feedback_request) && isset($_SESSION['feedback_request']) && preg_match("/^[a-z0-9\;\:]+$/", $_SESSION['feedback_request'])) {
|
571 |
$feedback_request = $_SESSION['feedback_request'];
|
1 |
<?php
|
2 |
|
3 |
+
$ct_agent_version = 'wordpress-5285';
|
4 |
$ct_plugin_name = 'Anti-spam by CleanTalk';
|
5 |
$ct_checkjs_frm = 'ct_checkjs_frm';
|
6 |
$ct_checkjs_register_form = 'ct_checkjs_register_form';
|
109 |
* @return null;
|
110 |
*/
|
111 |
function ct_init_session() {
|
112 |
+
$session_id = session_id();
|
113 |
+
if(empty($session_id) && !headers_sent()) {
|
114 |
+
session_start();
|
115 |
}
|
116 |
|
117 |
return null;
|
118 |
}
|
119 |
|
120 |
+
/**
|
121 |
+
* Session end
|
122 |
+
* @return null;
|
123 |
+
*/
|
124 |
+
function ct_end_session() {
|
125 |
+
session_destroy();
|
126 |
+
return null;
|
127 |
+
}
|
128 |
+
|
129 |
/**
|
130 |
* Inner function - Common part of request sending
|
131 |
* @param array Array of parameters:
|
262 |
|
263 |
// Restart submit form counter for failed requests
|
264 |
if ($ct_result->allow == 0) {
|
265 |
+
ct_init_session();
|
266 |
+
|
267 |
@header("CtBaseCall: result not allow");
|
268 |
$_SESSION[$ct_formtime_label] = time();
|
269 |
if(!isset($ct_result->errno)||isset($ct_result->errno)&&$ct_result->errno!=0)
|
294 |
*/
|
295 |
function submit_time_test() {
|
296 |
global $ct_formtime_label;
|
297 |
+
|
298 |
+
ct_init_session();
|
299 |
|
300 |
$submit_time = null;
|
301 |
if (isset($_SESSION[$ct_formtime_label])) {
|
559 |
if ($message !== null) {
|
560 |
$resultMessage = $ct->delCleantalkComment($message);
|
561 |
}
|
562 |
+
|
563 |
+
ct_init_session();
|
564 |
|
565 |
$ct_feedback = $hash . ':' . $allow . ';';
|
566 |
if (empty($_SESSION['feedback_request'])) {
|
582 |
|
583 |
$ct_options = ct_get_options();
|
584 |
$ct_data = ct_get_data();
|
585 |
+
|
586 |
+
ct_init_session();
|
587 |
|
588 |
if (empty($feedback_request) && isset($_SESSION['feedback_request']) && preg_match("/^[a-z0-9\;\:]+$/", $_SESSION['feedback_request'])) {
|
589 |
$feedback_request = $_SESSION['feedback_request'];
|
inc/cleantalk-public.php
CHANGED
@@ -17,23 +17,6 @@ function ct_init() {
|
|
17 |
unset($_POST['ct_checkjs_register_form']);
|
18 |
}
|
19 |
|
20 |
-
ct_init_session();
|
21 |
-
|
22 |
-
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
23 |
-
if (is_array($_SESSION) && !array_key_exists($ct_formtime_label, $_SESSION) && session_id() != '') {
|
24 |
-
$ct_direct_post = 1;
|
25 |
-
}
|
26 |
-
} else {
|
27 |
-
/*if(isset($_SERVER['HTTP_REFERER']) && stripos($_SERVER['HTTP_REFERER'],'preview')!==false)
|
28 |
-
{
|
29 |
-
//do nothing
|
30 |
-
}
|
31 |
-
else
|
32 |
-
{*/
|
33 |
-
$_SESSION[$ct_formtime_label] = time();
|
34 |
-
//}
|
35 |
-
}
|
36 |
-
|
37 |
if($test_external_forms && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cleantalk_hidden_method']) && isset($_POST['cleantalk_hidden_action']))
|
38 |
{
|
39 |
$action=htmlspecialchars($_POST['cleantalk_hidden_action']);
|
@@ -198,6 +181,24 @@ function ct_init() {
|
|
198 |
}
|
199 |
}
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
function ct_ajaxurl() {
|
202 |
?>
|
203 |
<script type="text/javascript">
|
@@ -858,6 +859,8 @@ function ct_login_message($message) {
|
|
858 |
$ct_data = ct_get_data();
|
859 |
|
860 |
if ($ct_options['registrations_test'] != 0) {
|
|
|
|
|
861 |
if( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) {
|
862 |
if (isset($_SESSION[$ct_session_register_ok_label])) {
|
863 |
unset($_SESSION[$ct_session_register_ok_label]);
|
@@ -1062,7 +1065,7 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1062 |
}
|
1063 |
|
1064 |
$submit_time = submit_time_test();
|
1065 |
-
|
1066 |
$sender_info = get_sender_info();
|
1067 |
|
1068 |
$checkjs=0;
|
@@ -1129,6 +1132,8 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1129 |
ct_send_error_notice($ct_result->comment);
|
1130 |
return $errors;
|
1131 |
}
|
|
|
|
|
1132 |
|
1133 |
if ($ct_result->allow == 0) {
|
1134 |
|
@@ -1158,6 +1163,8 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1158 |
*/
|
1159 |
function ct_user_register($user_id) {
|
1160 |
global $ct_session_request_id_label;
|
|
|
|
|
1161 |
|
1162 |
if (isset($_SESSION[$ct_session_request_id_label])) {
|
1163 |
update_user_meta($user_id, 'ct_hash', $_SESSION[$ct_session_request_id_label]);
|
@@ -1666,6 +1673,7 @@ function ct_s2member_registration_test() {
|
|
1666 |
|
1667 |
// Restart submit form counter for failed requests
|
1668 |
if ($ct_result->allow == 0) {
|
|
|
1669 |
$_SESSION[$ct_formtime_label] = time();
|
1670 |
}
|
1671 |
|
@@ -1699,24 +1707,27 @@ function ct_contact_form_validate () {
|
|
1699 |
}
|
1700 |
@header("CtExclusions: ".$ct_cnt);
|
1701 |
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
|
|
|
|
|
|
1720 |
|
1721 |
@header("CtConditions: Passed");
|
1722 |
|
@@ -1845,24 +1856,27 @@ function ct_contact_form_validate_postdata () {
|
|
1845 |
}
|
1846 |
@header("CtExclusions: ".$ct_cnt);
|
1847 |
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
|
|
|
|
|
|
1866 |
|
1867 |
$_POST=ct_filter_array($_POST);
|
1868 |
|
17 |
unset($_POST['ct_checkjs_register_form']);
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
if($test_external_forms && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cleantalk_hidden_method']) && isset($_POST['cleantalk_hidden_action']))
|
21 |
{
|
22 |
$action=htmlspecialchars($_POST['cleantalk_hidden_action']);
|
181 |
}
|
182 |
}
|
183 |
|
184 |
+
/**
|
185 |
+
* Init functions
|
186 |
+
* @return mixed[] Array of options
|
187 |
+
*/
|
188 |
+
function ct_init_after_all() {
|
189 |
+
global $ct_direct_post;
|
190 |
+
ct_init_session();
|
191 |
+
|
192 |
+
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
193 |
+
if (is_array($_SESSION) && !array_key_exists($ct_formtime_label, $_SESSION) && session_id() != '') {
|
194 |
+
$ct_direct_post = 1;
|
195 |
+
}
|
196 |
+
} else {
|
197 |
+
$_SESSION[$ct_formtime_label] = time();
|
198 |
+
}
|
199 |
+
|
200 |
+
};
|
201 |
+
|
202 |
function ct_ajaxurl() {
|
203 |
?>
|
204 |
<script type="text/javascript">
|
859 |
$ct_data = ct_get_data();
|
860 |
|
861 |
if ($ct_options['registrations_test'] != 0) {
|
862 |
+
ct_init_session();
|
863 |
+
|
864 |
if( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) {
|
865 |
if (isset($_SESSION[$ct_session_register_ok_label])) {
|
866 |
unset($_SESSION[$ct_session_register_ok_label]);
|
1065 |
}
|
1066 |
|
1067 |
$submit_time = submit_time_test();
|
1068 |
+
|
1069 |
$sender_info = get_sender_info();
|
1070 |
|
1071 |
$checkjs=0;
|
1132 |
ct_send_error_notice($ct_result->comment);
|
1133 |
return $errors;
|
1134 |
}
|
1135 |
+
|
1136 |
+
ct_init_session();
|
1137 |
|
1138 |
if ($ct_result->allow == 0) {
|
1139 |
|
1163 |
*/
|
1164 |
function ct_user_register($user_id) {
|
1165 |
global $ct_session_request_id_label;
|
1166 |
+
|
1167 |
+
ct_init_session();
|
1168 |
|
1169 |
if (isset($_SESSION[$ct_session_request_id_label])) {
|
1170 |
update_user_meta($user_id, 'ct_hash', $_SESSION[$ct_session_request_id_label]);
|
1673 |
|
1674 |
// Restart submit form counter for failed requests
|
1675 |
if ($ct_result->allow == 0) {
|
1676 |
+
ct_init_session();
|
1677 |
$_SESSION[$ct_formtime_label] = time();
|
1678 |
}
|
1679 |
|
1707 |
}
|
1708 |
@header("CtExclusions: ".$ct_cnt);
|
1709 |
|
1710 |
+
if(strpos($_SERVER['REQUEST_URI'],'about-us/contact-details/inquire')===false)
|
1711 |
+
{
|
1712 |
+
if (@sizeof($_POST)>0 ||
|
1713 |
+
(isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
|
1714 |
+
(isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
|
1715 |
+
strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false ||
|
1716 |
+
strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false ||
|
1717 |
+
strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false||
|
1718 |
+
strpos($_SERVER['REQUEST_URI'],'wp-comments-post.php')!==false ||
|
1719 |
+
@strpos($_SERVER['HTTP_REFERER'],'/wp-admin/')!==false ||
|
1720 |
+
strpos($_SERVER['REQUEST_URI'],'/login/')!==false||
|
1721 |
+
isset($_GET['ptype']) && $_GET['ptype']=='login' ||
|
1722 |
+
check_url_exclusions() ||
|
1723 |
+
ct_check_array_keys($_POST) ||
|
1724 |
+
isset($_POST['ct_checkjs_register_form']) ||
|
1725 |
+
(isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
|
1726 |
+
@intval($ct_options['general_contact_forms_test'])==0
|
1727 |
+
) {
|
1728 |
+
return null;
|
1729 |
+
}
|
1730 |
+
}
|
1731 |
|
1732 |
@header("CtConditions: Passed");
|
1733 |
|
1856 |
}
|
1857 |
@header("CtExclusions: ".$ct_cnt);
|
1858 |
|
1859 |
+
if(strpos($_SERVER['REQUEST_URI'],'about-us/contact-details/inquire')===false)
|
1860 |
+
{
|
1861 |
+
|
1862 |
+
if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
|
1863 |
+
(isset($_POST['log']) && isset($_POST['pwd']) && isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
|
1864 |
+
(isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword')||
|
1865 |
+
ct_check_array_keys($_POST) ||
|
1866 |
+
(isset($pagenow) && $pagenow == 'wp-cron.php' ||
|
1867 |
+
strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false) ||
|
1868 |
+
strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false ||
|
1869 |
+
strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false ||
|
1870 |
+
strpos($_SERVER['REQUEST_URI'],'wp-comments-post.php')!==false ||
|
1871 |
+
@strpos($_SERVER['HTTP_REFERER'],'/wp-admin/')!==false ||
|
1872 |
+
check_url_exclusions() ||
|
1873 |
+
strpos($_SERVER['REQUEST_URI'],'/login/')!==false ||
|
1874 |
+
isset($_POST['ct_checkjs_register_form']) ||
|
1875 |
+
@intval($ct_options['general_postdata_test'])==0
|
1876 |
+
) {
|
1877 |
+
return null;
|
1878 |
+
}
|
1879 |
+
}
|
1880 |
|
1881 |
$_POST=ct_filter_array($_POST);
|
1882 |
|
inc/cleantalk-users.php
CHANGED
@@ -484,4 +484,4 @@ function ct_ajax_clear_users()
|
|
484 |
$wpdb->query("delete from $wpdb->usermeta where meta_key='ct_hash' or meta_key='ct_checked' or meta_key='ct_marked_as_spam';");
|
485 |
die();
|
486 |
}
|
487 |
-
?>
|
484 |
$wpdb->query("delete from $wpdb->usermeta where meta_key='ct_hash' or meta_key='ct_checked' or meta_key='ct_marked_as_spam';");
|
485 |
die();
|
486 |
}
|
487 |
+
?>
|
screenshot-4.png
CHANGED
Binary file
|
screenshot-5.png
CHANGED
Binary file
|