If I install reCAPTCHA and set it to be used by a form but I do not configure reCAPTCHA, any page which should contain the reCAPTCHA is blank except for this message:
To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create
This has the potential to completely break a web site. If reCAPTCHA is not configured, Drupal should behave as if there is no CAPTCHA configured or perhaps fall-back to a default CAPTCHA.
(I wonder what happens if reCAPTCHA is properly configured, but the reCAPTCHA servers go down or are inaccessible. Does that also trigger a similar problem?)
Comment | File | Size | Author |
---|---|---|---|
#3 | recaptcha_unconfigured_1681746.patch | 618 bytes | Liam Morland |
#2 | recaptcha_unconfigured_1681746.patch | 730 bytes | Liam Morland |
#1 | recaptcha_unconfigured_1681746.patch | 2.37 KB | Liam Morland |
Comments
Comment #1
Liam MorlandThe reCAPTCHA module calls die() when not configured. The attached patch causes it to instead display a message and always behave as if the CAPTCHA was valid. In other words, having reCAPTCHA unconfigured will not break your site.
Comment #2
Liam MorlandGoing through the code some more, I have come up with a much better solution. This one only changes recaptcha.module and causes CAPTCHA to fallback to the built-in math CAPTCHA when reCAPTCHA is not configured.
Comment #3
Liam MorlandI must be having a slow day. Here is a simpler, better patch that implements the fallback to math.
Comment #4
RobLoachThanks! Looks good! Mind committing this it? :-)
Comment #5
RobLoachComment #6
Liam MorlandFixed in e1515c0.
Comment #7
Liam MorlandComment #8
Liam MorlandComment #9
Liam MorlandThis can be combined with #1734952: Fail gracefully instead of calling die().
Comment #13
hass CreditAttribution: hass commented