Skip to content

Commit

Permalink
update submit_time logic
Browse files Browse the repository at this point in the history
  • Loading branch information
davydovct committed Jun 9, 2018
1 parent af22736 commit de2d855
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cleantalkMod.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,11 @@ function cleantalk_store_form_start_time()
*/
function cleantalk_get_form_submit_time()
{
return isset($_SESSION['ct_form_start_time']) ? time() - intval($_SESSION['ct_form_start_time']) : null;
$cookie_submit_time = isset($_COOKIE['apbct_timestamp']) ? time() - intval($_COOKIE['apbct_timestamp']): 0;
if ($cookie_submit_time > 2)
return $cookie_submit_time;
else
return isset($_SESSION['ct_form_start_time']) ? time() - intval($_SESSION['ct_form_start_time']) : 0;
}

/**
Expand Down

0 comments on commit de2d855

Please sign in to comment.