Skip to content

Commit

Permalink
added perch form validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ImpressionEngineering committed Sep 21, 2021
1 parent 88126a3 commit dc5e3c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion perch/addons/apps/impeng_cleantalk/admin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

if ($CurrentUser->logged_in()) {
$this->register_app('impeng_cleantalk', 'CleanTalk Anti Spam', 50, 'CleanTalk anti spam for Perch Forms', '0.1', true);
$this->register_app('impeng_cleantalk', 'CleanTalk Anti Spam', 50, 'CleanTalk anti spam for Perch Forms', '0.3', true);
$this->require_version('impeng_cleantalk', '3.0');

$API = new PerchAPI(1.0, 'impeng_cleantalk');
Expand Down
3 changes: 2 additions & 1 deletion perch/addons/apps/impeng_cleantalk/runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use lib\CleantalkAPI;

function impeng_cleantalk_form_handler($SubmittedForm) {
if($SubmittedForm->validate()) {
$API = new PerchAPI(1.0, 'impeng_cleantalk');
$Settings = $API->get('Settings');
$data = $SubmittedForm->data;
Expand Down Expand Up @@ -119,5 +120,5 @@ function impeng_cleantalk_form_handler($SubmittedForm) {
unset($SubmittedForm->data['js_on']);
//Redispatch all submitted forms to Perch forms regardless of enabled/disabled and CleanTalk result
$SubmittedForm->redispatch('perch_forms');

}
}

0 comments on commit dc5e3c6

Please sign in to comment.