Skip to content

Commit 202e3e9

Browse files
committed
Fix. CF7. Edit honeypot
1 parent 47468fc commit 202e3e9

1 file changed

Lines changed: 22 additions & 14 deletions

File tree

inc/cleantalk-public-integrations.php

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,11 @@ function apbct_form__contactForm7__testSpam($spam, $_submission = null)
14601460
*/
14611461
$input_array = apply_filters('apbct__filter_post', $_POST);
14621462

1463+
$honeypot_params = array();
1464+
if ( isset($input_array['apbct__email_id__wp_contact_form_7']) ) {
1465+
$honeypot_params['honeypot_field'] = ($input_array['apbct__email_id__wp_contact_form_7'] === '') ? 1 : 0;
1466+
}
1467+
14631468
$ct_temp_msg_data = ct_get_fields_any($input_array);
14641469

14651470
$sender_email = isset($ct_temp_msg_data['email']) ? $ct_temp_msg_data['email'] : '';
@@ -1472,21 +1477,24 @@ function apbct_form__contactForm7__testSpam($spam, $_submission = null)
14721477
}
14731478

14741479
$base_call_result = apbct_base_call(
1475-
array(
1476-
'message' => $message,
1477-
'sender_email' => $sender_email,
1478-
'sender_nickname' => $sender_nickname,
1479-
'js_on' => $checkjs,
1480-
'post_info' => array('comment_type' => 'contact_form_wordpress_cf7'),
1481-
'sender_info' => array(
1482-
'form_validation' => ! isset($apbct->validation_error)
1483-
? null
1484-
: json_encode(array(
1485-
'validation_notice' => $apbct->validation_error,
1486-
'page_url' => TT::toString(Server::get('HTTP_HOST')) . TT::toString(Server::get('REQUEST_URI')),
1487-
)),
1488-
'sender_emails_array' => $sender_emails_array,
1480+
array_merge(
1481+
array(
1482+
'message' => $message,
1483+
'sender_email' => $sender_email,
1484+
'sender_nickname' => $sender_nickname,
1485+
'js_on' => $checkjs,
1486+
'post_info' => array('comment_type' => 'contact_form_wordpress_cf7'),
1487+
'sender_info' => array(
1488+
'form_validation' => ! isset($apbct->validation_error)
1489+
? null
1490+
: json_encode(array(
1491+
'validation_notice' => $apbct->validation_error,
1492+
'page_url' => TT::toString(Server::get('HTTP_HOST')) . TT::toString(Server::get('REQUEST_URI')),
1493+
)),
1494+
'sender_emails_array' => $sender_emails_array,
1495+
),
14891496
),
1497+
$honeypot_params
14901498
)
14911499
);
14921500

0 commit comments

Comments
 (0)