diff --git a/inc/helpers/namespace.php b/inc/helpers/namespace.php index 8f521ba..1f2e42f 100644 --- a/inc/helpers/namespace.php +++ b/inc/helpers/namespace.php @@ -259,6 +259,10 @@ function handle_contact_form_submission() { return false; // Security check failed. } if ( isset( $_POST['submitted'] ) ) { + // Check the fake anti-spam honeypot field. + if ( ! empty( $_POST['firstname'] ) ) { + return false; // Honeypot failed. + } $contact_email = get_option( 'pb_network_contact_email', get_option( 'admin_email' ) ); $output = []; $name = ( isset( $_POST['visitor_name'] ) ) ? $_POST['visitor_name'] : ''; @@ -315,7 +319,7 @@ function handle_contact_form_submission() { } return $output; } - return; + return false; } /** diff --git a/partials/contact-form.php b/partials/contact-form.php index 67f7e10..6678da5 100644 --- a/partials/contact-form.php +++ b/partials/contact-form.php @@ -22,6 +22,12 @@ $contact_form_response = \Aldine\Helpers\handle_contact_form_submission(); +