File tree Expand file tree Collapse file tree
lib/Cleantalk/Antispam/Integrations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 404404 'setting ' => 'forms__contact_forms_test ' ,
405405 'ajax ' => false
406406 ),
407+ 'ChatyContactForm ' => array (
408+ 'hook ' => 'chaty_front_form_save_data ' ,
409+ 'setting ' => 'forms__contact_forms_test ' ,
410+ 'ajax ' => true
411+ ),
407412);
408413
409414add_action ('plugins_loaded ' , function () use ($ apbct_active_integrations ) {
Original file line number Diff line number Diff line change @@ -1522,13 +1522,21 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms')
15221522 return 'fusion_form/avada_theme skip ' ;
15231523 }
15241524
1525- // skip Newsletter - have direct integration
1525+ // skip Newsletter - has direct integration
15261526 if (
15271527 apbct_is_plugin_active ('newsletter/plugin.php ' ) &&
15281528 Request::getString ('action ' ) === 'tnp '
15291529 ) {
15301530 return 'Newsletter ' ;
15311531 }
1532+
1533+ // skip ChatyContactForm - has direct integration
1534+ if (
1535+ apbct_is_plugin_active ('chaty/cht-icons.php ' ) &&
1536+ Request::getString ('action ' ) === 'chaty_front_form_save_data '
1537+ ) {
1538+ return 'ChatyContactForm ' ;
1539+ }
15321540 } else {
15331541 /*****************************************/
15341542 /* Here is non-ajax requests skipping */
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Cleantalk \Antispam \Integrations ;
4+
5+ use Cleantalk \ApbctWP \Variables \Request ;
6+ use Cleantalk \ApbctWP \Variables \Post ;
7+
8+ class ChatyContactForm extends IntegrationBase
9+ {
10+ public function getDataForChecking ($ argument )
11+ {
12+ if ( Request::get ('nonce ' ) ) {
13+ $ event_token = Post::getString ('ct_bot_detector_event_token ' );
14+ /**
15+ * Filter for POST
16+ */
17+ $ input_array = apply_filters ('apbct__filter_post ' , $ _POST );
18+
19+ unset($ input_array ['apbct_visible_fields ' ]);
20+
21+ $ base_call_data = ct_gfa_dto ($ input_array )->getArray ();
22+
23+ $ base_call_data ['event_token ' ] = $ event_token ;
24+
25+ if (isset ($ base_call_data ['message ' ]['message ' ])) {
26+ $ base_call_data ['message ' ] = $ base_call_data ['message ' ]['message ' ];
27+ }
28+
29+ return $ base_call_data ;
30+ }
31+
32+ return null ;
33+ }
34+
35+ public function doBlock ($ message )
36+ {
37+ $ response = [
38+ 'status ' => 0 ,
39+ 'error ' => '' ,
40+ 'errors ' => [],
41+ 'message ' => $ message ,
42+ ];
43+ wp_send_json ($ response );
44+ exit ;
45+ }
46+ }
You can’t perform that action at this time.
0 commit comments