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?)


Status:Active» Needs review
new2.37 KB

The 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.

new730 bytes

Going 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.

new618 bytes

I must be having a slow day. Here is a simpler, better patch that implements the fallback to math.

Status:Needs review» Reviewed & tested by the community

Thanks! Looks good! Mind committing this it? :-)

Assigned:Unassigned» Liam Morland

Status:Reviewed & tested by the community» Fixed

Fixed in e1515c0.

Version:7.x-1.x-dev» 6.x-1.x-dev
Status:Fixed» Patch (to be ported)

Assigned:Liam Morland» Unassigned