If arg_separator.output is set to something other than '&' (it is '&' on many hosts), reCAPTCHA validation fails.

The google/recaptcha library that is bundled with with recaptcha.module is version 1.1.1. The 1.1.x-dev version already has this fix applied (the patch was accepted last March).

Relevant links:
https://github.com/google/recaptcha/commit/145bf9d2cd2f985c56e2884b42872...
https://packagist.org/packages/google/recaptcha

CommentFileSizeAuthor
#3 recaptcha-2530156-3-arg-separator.patch493 bytesdaniel_j
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

daniel_j’s picture

Issue summary: View changes
daniel_j’s picture

daniel_j’s picture

This patch is an interim fix.

hass’s picture

Category: Bug report » Support request
Status: Needs review » Fixed

Fix your broken drupal settings file as noted in https://www.drupal.org/node/2476237, please.

Liam Morland’s picture

xurizaemon’s picture

Status: Fixed » Reviewed & tested by the community

I can't speak for why sites might need alternate arg_separator.output values, but the reality is that it's a supported use case both of PHP and of reCAPTCHA, and we can resolve the issue with a small patch to this module. The solution was considered valid enough for the upstream library to add it.

If reCAPTCHA supports this, I think we can too. Since reCAPTCHA requires a specific arg_separator.output setting, this module can / should enforce that in the request generation.

Is there a downside you see to that approach @hass?

xurizaemon’s picture

Category: Support request » Feature request
xurizaemon’s picture

Status: Reviewed & tested by the community » Needs work

I see this patch above is interim, pending an update of the reCAPTCHA library which is bundled. So there are a few solutions - patch the module, patch the bundled lib, or upgrade the bundled lib, or existing solution (document that reCAPTCHA module requires specific php config / tell people to fix their settings).

Current bundled version is 1.1.1 (#2472811: Upgrade lib to latest version), 2015-03-10, while the fix for this issue was committed to upstream library a couple of weeks after 1.1.1.

hass’s picture

Category: Feature request » Support request
Status: Needs work » Fixed

Remove the incorrect arg seperator from your core config file. It is NOT used by core and an invalid leftover. I'm only committing final versions of the recaptcha lib.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ariane’s picture

I have used the patch and the reCAPTCHA still fails on submission.

It is a D7, in the settings.php there is not the line ini_set('arg_separator.output', '&'); and I have checked the phpinfo().php and the values for arg_separator.output and arg_separator.output are &

I have also used another reCaptcha like Math Challenge and works fine.

hass’s picture

Create a new site key and secret.