|
|
|
@ -9,6 +9,7 @@ namespace Aldine\Helpers;
|
|
|
|
|
|
|
|
|
|
use function \Pressbooks\Metadata\book_information_to_schema; |
|
|
|
|
use function \Pressbooks\Metadata\is_bisac; |
|
|
|
|
use function \Pressbooks\Utility\str_starts_with; |
|
|
|
|
use Pressbooks\Book; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -259,6 +260,12 @@ function handle_contact_form_submission() {
|
|
|
|
|
return false; // Security check failed. |
|
|
|
|
} |
|
|
|
|
if ( isset( $_POST['submitted'] ) ) { |
|
|
|
|
// Check the fake anti-spam honeypot field. |
|
|
|
|
foreach ( $_POST as $pkey => $pval ) { |
|
|
|
|
if ( str_starts_with( $pkey, 'firstname' ) && ! empty( $pval ) ) { |
|
|
|
|
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 +322,7 @@ function handle_contact_form_submission() {
|
|
|
|
|
} |
|
|
|
|
return $output; |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|