/** * process_recaptcha * * @access private * @return boolean */ private static function _process_recaptcha_response() { // verify library is loaded if (!class_exists('\\ReCaptcha\\ReCaptcha')) { require_once RECAPTCHA_BASE_PATH . DS . 'autoload.php'; } // The response from reCAPTCHA EED_Recaptcha::_get_recaptcha_response(); $recaptcha_response = EED_Recaptcha::$_recaptcha_response; // Was there a reCAPTCHA response? if ($recaptcha_response) { // if allow_url_fopen is Off, then set a different request method $request_method = !ini_get('allow_url_fopen') ? new \ReCaptcha\RequestMethod\SocketPost() : null; $recaptcha = new \ReCaptcha\ReCaptcha(EE_Registry::instance()->CFG->registration->recaptcha_privatekey, $request_method); $recaptcha_response = $recaptcha->verify(EED_Recaptcha::$_recaptcha_response, $_SERVER['REMOTE_ADDR']); } if ($recaptcha_response instanceof \ReCaptcha\Response && $recaptcha_response->isSuccess()) { return TRUE; } // sorry... it appears you can't don't know what soup or hamburgers are !!! return FALSE; }
/** * process_recaptcha * * @access private * @return boolean */ private static function _process_recaptcha_response() { // verify library is loaded if (!class_exists('ReCaptcha')) { require_once RECAPTCHA_BASE_PATH . 'recaptchalib.php'; } // The response from reCAPTCHA EED_Recaptcha::_get_recaptcha_response(); $recaptcha_response = EED_Recaptcha::$_recaptcha_response; // Was there a reCAPTCHA response? if ($recaptcha_response) { $reCaptcha = new ReCaptcha(EE_Registry::instance()->CFG->registration->recaptcha_privatekey); $recaptcha_response = $reCaptcha->verifyResponse($_SERVER['REMOTE_ADDR'], EED_Recaptcha::$_recaptcha_response); } // sorry... it appears you can't read gibberish chicken scratches !!! if ($recaptcha_response instanceof ReCaptchaResponse && $recaptcha_response->success) { return TRUE; } return FALSE; }