Skip to content

Commit 1e95918

Browse files
author
davydov
committed
fix submit time
1 parent 78610c7 commit 1e95918

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cleantalkMod.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,12 @@ function cleantalk_cookies_set() {
371371
'check_value' => cleantalk_get_api_key(),
372372
);
373373

374+
// Submit time
375+
$ct_timestamp = time();
376+
setcookie('ct_timestamp', $ct_timestamp, 0, '/');
377+
$cookie_test_value['cookies_names'][] = 'ct_timestamp';
378+
$cookie_test_value['check_value'] .= $ct_timestamp;
379+
374380
// Pervious referer
375381
if(!empty($_SERVER['HTTP_REFERER'])){
376382
setcookie('ct_prev_referer', $_SERVER['HTTP_REFERER'], 0, '/');
@@ -846,8 +852,8 @@ function cleantalk_get_form_submit_time()
846852
{
847853
if (isset($_SESSION['ct_form_start_time']))
848854
return time() - intval($_SESSION['ct_form_start_time']);
849-
elseif (isset($_COOKIE['ct_ps_timestamp']))
850-
return time() - intval($_COOKIE['ct_ps_timestamp']);
855+
elseif (isset($_COOKIE['ct_timestamp']))
856+
return time() - intval($_COOKIE['ct_timestamp']);
851857
}
852858
return null;
853859
}

0 commit comments

Comments
 (0)