diff --git a/app/code/community/NoGlitchYo/GoogleRecaptcha/Model/Validator.php b/app/code/community/NoGlitchYo/GoogleRecaptcha/Model/Validator.php index a8aceea..0209328 100644 --- a/app/code/community/NoGlitchYo/GoogleRecaptcha/Model/Validator.php +++ b/app/code/community/NoGlitchYo/GoogleRecaptcha/Model/Validator.php @@ -36,6 +36,9 @@ public function validate() try { $data = $this->_request($captchaResponse, $secret); + if (empty($data)) { + return false; + } } catch (Exception $e) { return false; } @@ -68,10 +71,12 @@ protected function _request($captchaResponse, $secret) catch (Zend_Http_Exception $e) { Mage::logException($e); Mage::getSingleton('customer/session')->addError(Mage::helper('grecaptcha')->__('Unable to validate the reCAPTCHA with Google. Please, retry later.')); + return null; } catch (Exception $e) { Mage::logException($e); Mage::getSingleton('customer/session')->addError(Mage::helper('grecaptcha')->__('Unable to validate the reCAPTCHA.')); + return null; } return $this->_parseResponse($response);