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 commented