For a long time I posted error-validating-the-captcha a post about solving the captcha misbehaviour on some servers and offered a solution for it. Now I had just updated one of my GRAV projects and had to realize that this error is still contained in the form-plugin core script.
That makes me very sad. At that time I had invested a lot of time in finding a solution and had hoped to be able to contribute to making GRAV more stable. But even back then, my proposal failed without comment and therefore did not find a way into the core. Maybe a member of the core team will find time to take a look at my code proposal and check if it is valid.
Of course, my code proposal from that time is no longer valid for the current version of new 2.10.x version of the script user/plugins/form/form.php, so here are the lines like I replaced them in my project:
Original version of form.php line 300:
$query = http_build_query([
'secret' => $recaptchaSecret,
'response' => $form->value('g-recaptcha-response', true)
]);
and my modified code:
$query = '';
$queryArr = array(
'secret' => $recaptchaSecret,
'response' => $form->value('g-recaptcha-response', true),
'remoteip' => $_SERVER['REMOTE_ADDR'],
'v' => 'php_1.0',
);
foreach ($queryArr as $key => $value) {
$query .= $key . '=' . urlencode(stripslashes($value)) . '&';
}
$query = substr($query, 0, strlen($query) - 1);