Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#3 | recaptcha-2530156-3-arg-separator.patch | 493 bytes | daniel_j |
Comments
Comment #1
daniel_j CreditAttribution: daniel_j commentedComment #2
daniel_j CreditAttribution: daniel_j commentedSee also: https://www.drupal.org/node/2476237
Comment #3
daniel_j CreditAttribution: daniel_j commentedThis patch is an interim fix.
Comment #4
hass CreditAttribution: hass commentedFix your broken drupal settings file as noted in https://www.drupal.org/node/2476237, please.
Comment #5
Liam MorlandComment #6
xurizaemonI 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?
Comment #7
xurizaemonComment #8
xurizaemonI 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.
Comment #9
hass CreditAttribution: hass commentedRemove 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.
Comment #11
ariane CreditAttribution: ariane commentedI 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.
Comment #12
hass CreditAttribution: hass commentedCreate a new site key and secret.