From a7e53b43c312013e2cb1f81759ed38e3c76b8a48 Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Thu, 18 Aug 2022 17:03:21 +0100 Subject: [PATCH] fixes for missing recaptcha_check_answer() when validate is called by other extensions --- ext/recaptcha/CRM/Utils/ReCAPTCHA.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/recaptcha/CRM/Utils/ReCAPTCHA.php b/ext/recaptcha/CRM/Utils/ReCAPTCHA.php index 33c78e174f9c..85e483dd19c1 100644 --- a/ext/recaptcha/CRM/Utils/ReCAPTCHA.php +++ b/ext/recaptcha/CRM/Utils/ReCAPTCHA.php @@ -202,6 +202,8 @@ public static function checkAndAddCaptchaToForm($formName, &$form) { * @return mixed */ public static function validate($value, $form) { + require_once E::path('lib/recaptcha/recaptchalib.php'); + $resp = recaptcha_check_answer(CRM_Core_Config::singleton()->recaptchaPrivateKey, $_SERVER['REMOTE_ADDR'], $_POST['g-recaptcha-response']