diff --git a/composer.json b/composer.json index 5afed282a656db50ca3fb6f3fd3eb607f51d6c00..8f98e2fa507c0e58fa64af228fb82432281a8a65 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,6 @@ "aferrandini/phpqrcode": "1.0.1", "jasig/phpcas": "1.3.4", "cap60552/php-sip2": "1.0.0", - "los/losrecaptcha": "2.0.2", "ahand/mobileesp": "dev-master", "matthiasmullie/minify": "1.3.43", "ocramius/proxy-manager": "1.0.2", @@ -57,6 +56,7 @@ "zendframework/zend-view": "2.8.1", "zendframework/zendrest": "2.0.2", "zendframework/zendservice-amazon": "2.0.4", + "zendframework/zendservice-recaptcha": "3.0.0", "zf-commons/zfc-rbac": "2.5.3" }, "require-dev": { diff --git a/module/VuFind/src/VuFind/Controller/Plugin/Recaptcha.php b/module/VuFind/src/VuFind/Controller/Plugin/Recaptcha.php index 8426b33d0a6943850726d9a74372325a38f3feb3..b5c15efc686cda999b797b41efb20a8f8a77ec37 100644 --- a/module/VuFind/src/VuFind/Controller/Plugin/Recaptcha.php +++ b/module/VuFind/src/VuFind/Controller/Plugin/Recaptcha.php @@ -124,7 +124,7 @@ class Recaptcha extends AbstractPlugin } catch (\ZendService\ReCaptcha\Exception $e) { $response = false; } - $captchaPassed = $response && $response->isSuccess(); + $captchaPassed = $response && $response->isValid(); if (!$captchaPassed && $this->errorMode != 'none') { if ($this->errorMode == 'flash') { $this->getController()->flashMessenger() diff --git a/module/VuFind/src/VuFind/Service/Factory.php b/module/VuFind/src/VuFind/Service/Factory.php index 1021db05cd5c305a8d128c6df6570278b157d4a0..8bb152163cd2753da618dd390ed293b117b3fff9 100644 --- a/module/VuFind/src/VuFind/Service/Factory.php +++ b/module/VuFind/src/VuFind/Service/Factory.php @@ -532,9 +532,7 @@ class Factory $options['theme'] = $config->Captcha->theme; } $recaptcha = new \VuFind\Service\ReCaptcha( - $siteKey, $secretKey, - new \LosReCaptcha\Service\Request\ZendHttpClient($httpClient), - ['ssl' => true], $options + $siteKey, $secretKey, ['ssl' => true], $options, null, $httpClient ); return $recaptcha; diff --git a/module/VuFind/src/VuFind/Service/ReCaptcha.php b/module/VuFind/src/VuFind/Service/ReCaptcha.php index e693289803e1fd22826c6a1897087642a2af8257..fc2a3c2ae81c5028cd25702838e97ab0d84af4b2 100644 --- a/module/VuFind/src/VuFind/Service/ReCaptcha.php +++ b/module/VuFind/src/VuFind/Service/ReCaptcha.php @@ -36,7 +36,7 @@ namespace VuFind\Service; * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development Wiki */ -class ReCaptcha extends \LosReCaptcha\Service\ReCaptcha +class ReCaptcha extends \ZendService\ReCaptcha\ReCaptcha { /** * Get the HTML code for the captcha