Since file_get_contents is not configured on your site for non-local files, you'll need to edit /includes/classes/observers/class.google_recaptcha.php. Find the section:
Code:
function update(&$class, $eventID, $paramsArray = array()) {
global $messageStack, $error, $privatekey;
require_once __DIR__ . '/google/autoload.php';
$recaptcha = new \ReCaptcha\ReCaptcha($privatekey);
// If file_get_contents() is locked down on your PHP installation to disallow
// its use with URLs, then you can use the alternative request method instead.
// This makes use of fsockopen() instead.
//$recaptcha = new \ReCaptcha\ReCaptcha($privatekey, new \ReCaptcha\RequestMethod\SocketPost());
// This makes use of curl instead
//$recaptcha = new \ReCaptcha\ReCaptcha($privatekey, new \ReCaptcha\RequestMethod\Curl());
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()) {
$event_array = array('NOTIFY_CONTACT_US_CAPTCHA_CHECK' => 'contact', 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK' => 'create_account', 'NOTIFY_REVIEWS_WRITE_CAPTCHA_CHECK' => 'review_text');
$messageStack->add($event_array[$eventID], $resp->getErrors());
$error = true;
}
return $error;
}
and change that as below, adding comments before the one line and removing the comments (//) from the other
Code:
function update(&$class, $eventID, $paramsArray = array()) {
global $messageStack, $error, $privatekey;
require_once __DIR__ . '/google/autoload.php';
// $recaptcha = new \ReCaptcha\ReCaptcha($privatekey);
// If file_get_contents() is locked down on your PHP installation to disallow
// its use with URLs, then you can use the alternative request method instead.
// This makes use of fsockopen() instead.
//$recaptcha = new \ReCaptcha\ReCaptcha($privatekey, new \ReCaptcha\RequestMethod\SocketPost());
// This makes use of curl instead
$recaptcha = new \ReCaptcha\ReCaptcha($privatekey, new \ReCaptcha\RequestMethod\Curl());
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()) {
$event_array = array('NOTIFY_CONTACT_US_CAPTCHA_CHECK' => 'contact', 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK' => 'create_account', 'NOTIFY_REVIEWS_WRITE_CAPTCHA_CHECK' => 'review_text');
$messageStack->add($event_array[$eventID], $resp->getErrors());
$error = true;
}
return $error;
}
Bookmarks