Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/global/code/Submissions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ public static function processFormSubmission($form_data)
exit;
}

// was there a reCAPTCHA response? If so, a recaptcha was just submitted. This generally implies the
// form page included the API, so check it was entered correctly. If not, return the user to the webpage
if (isset($api_enabled) && isset($form_data["g-recaptcha-response"])) {

// Are the reCaptcha config variables set? If so, a recaptcha is required so check it is valid.
// If not, return the user to the webpage.
if (isset($api_enabled) && ! empty(Core::getAPIRecaptchaSecretKey()) && ! empty(Core::getApiRecaptchaSiteKey())) {
$api = new API(array("init_core" => false));
$api->includeRecaptchaLib();
$resp = $api->validateRecaptcha($form_data["g-recaptcha-response"]);
Expand Down