UserConfig::get('recaptcha_secret_key'), 'response' => $response, 'remoteip' => $clientIpAddress )); $return = json_decode(curl_exec($ch)); if (is_null($return)) { $message = 'Error while communicating with the reCAPTCHA service.'; $curlError = curl_error($ch); if (strlen($curlError) > 0) { $message .= ' ' . $curlError; } throw new \Exception($message); } return $return->success; } }