diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index 6aae275f18ddf..ed97e6fe296fb 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -47,14 +47,8 @@ public function onInit($id = 'dynamic_recaptcha_1') if ($this->params->get('version', '1.0') === '1.0') { - JHtml::_('jquery.framework'); - - $theme = $this->params->get('theme', 'clean'); - $file = 'https://www.google.com/recaptcha/api/js/recaptcha_ajax.js'; - - JHtml::_('script', $file); - JFactory::getDocument()->addScriptDeclaration('jQuery( document ).ready(function() - {Recaptcha.create("' . $pubkey . '", "' . $id . '", {theme: "' . $theme . '",' . $this->_getLanguage() . 'tabindex: 0});});'); + // Deprecated - @see https://developers.google.com/recaptcha/docs/faq#what-happens-to-recaptcha-v1 + return true; } else { @@ -84,7 +78,8 @@ public function onDisplay($name = null, $id = 'dynamic_recaptcha_1', $class = '' { if ($this->params->get('version', '1.0') === '1.0') { - return '
'; + // Deprecated - @see https://developers.google.com/recaptcha/docs/faq#what-happens-to-recaptcha-v1 + return ''; } else { @@ -115,9 +110,8 @@ public function onCheckAnswer($code = null) switch ($version) { case '1.0': - $challenge = $input->get('recaptcha_challenge_field', '', 'string'); - $response = $input->get('recaptcha_response_field', '', 'string'); - $spam = ($challenge === '' || $response === ''); + // Deprecated - @see https://developers.google.com/recaptcha/docs/faq#what-happens-to-recaptcha-v1 + return true; break; case '2.0': // Challenge Not needed in 2.0 but needed for getResponse call @@ -173,25 +167,8 @@ private function getResponse($privatekey, $remoteip, $response, $challenge = nul switch ($version) { case '1.0': - $response = $this->_recaptcha_http_post( - 'www.google.com', '/recaptcha/api/verify', - array( - 'privatekey' => $privatekey, - 'remoteip' => $remoteip, - 'challenge' => $challenge, - 'response' => $response - ) - ); - - $answers = explode("\n", $response[1]); - - if (trim($answers[0]) !== 'true') - { - // @todo use exceptions here - $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_' . strtoupper(str_replace('-', '_', $answers[1])))); - - return false; - } + // Deprecated - @see https://developers.google.com/recaptcha/docs/faq#what-happens-to-recaptcha-v1 + return true; break; case '2.0': require_once 'recaptchalib.php';