Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to validate when PHP setting arg_separator.output = '&' #19

Open
LosHawlos opened this issue Aug 31, 2017 · 1 comment
Open

Comments

@LosHawlos
Copy link

Tracked down an issue in our PHP setup where the captcha failed to validate.
Google server response: "missing-input-response"

It is caused by our PHP INI that has the setting:
arg_separator.output = "&"

This leads to the query string generated using http_build_query() to be concatenated by the separator & which makes the google server fail to parse the post parameters.

My fix is to force it to use a single '&' in /Validate/Recaptcha.php#L81:

    $queryString = http_build_query([
        'secret'   => $this->_secretKey,
        'response' => $value,
        'remoteIp' => $_SERVER['REMOTE_ADDR']
    ], '', '&');
@cgsmith
Copy link
Owner

cgsmith commented Sep 1, 2017

Nice work tracking that down! The separator output is default of & - do you have it as & for some reason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants