From 125189e3ae0ec8f1e8767b811812fdaa8d999a66 Mon Sep 17 00:00:00 2001 From: Kevin Andrews Date: Tue, 8 May 2018 14:54:10 +0100 Subject: [PATCH] Post params updated to v2. --- inc/Zend/Service/ReCaptcha.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/inc/Zend/Service/ReCaptcha.php b/inc/Zend/Service/ReCaptcha.php index cc82cd2..f4acd2c 100644 --- a/inc/Zend/Service/ReCaptcha.php +++ b/inc/Zend/Service/ReCaptcha.php @@ -391,10 +391,6 @@ public function getHtml($name = null) $host = self::API_SERVER; - if ((bool) $this->_params['ssl'] === true) { - $host = self::API_SECURE_SERVER; - } - $paramsEncoded = ''; if (!empty($this->_options)) { @@ -409,7 +405,7 @@ public function getHtml($name = null) } $script = << + SCRIPT; @@ -428,7 +424,7 @@ public function getHtml($name = null) * @return Zend_Http_Response * @throws Zend_Service_ReCaptcha_Exception */ - protected function _post($challengeField, $responseField) + protected function _post($responseField) { if ($this->_privateKey === null) { /** @see Zend_Service_ReCaptcha_Exception */ @@ -448,10 +444,11 @@ protected function _post($challengeField, $responseField) $httpClient = self::getHttpClient(); $httpClient->resetParameters(true); - $postParams = array('privatekey' => $this->_privateKey, - 'remoteip' => $this->_ip, - 'challenge' => $challengeField, - 'response' => $responseField); + $postParams = array( + 'secret' => $this->_privateKey, + 'remoteip' => $this->_ip, + 'response' => $responseField + ); /* Make the POST and return the response */ return $httpClient->setUri(self::VERIFY_SERVER) @@ -469,9 +466,9 @@ protected function _post($challengeField, $responseField) * @param string $responseField * @return Zend_Service_ReCaptcha_Response */ - public function verify($challengeField, $responseField) + public function verify($responseField) { - $response = $this->_post($challengeField, $responseField); + $response = $this->_post($responseField); return new Zend_Service_ReCaptcha_Response(null, null, $response); }