Undefined index: error-codes in recaptcha_check_answer()
Overview
When non-authenticated user subscribes to mailing list at /civicrm/mailing/subscribe, checks the "I am not a robot" reCAPTCHA, and clicks subscribe. The subscription request is processed properly, but an error is thrown:
Notice: Undefined index: error-codes in recaptcha_check_answer() (line 159 of /bitnami/drupal/modules/contrib/civicrm/ext/recaptcha/lib/recaptcha/recaptchalib.php).
Reproduction steps
- /civicrm/mailing/subscribe
- complete email address, check relevant mailing list (in this case, "General Newsletter")
- Check "I'm not a robot" in reCAPTCHA
- Click "Subscribe"
- Subscription is processed properly.
- Error reported on confirmation page.
Current behaviour
Error message presented. Functionality of reCAPTCHA and subscription is okay.
Notice: Undefined index: error-codes in recaptcha_check_answer() (line 159 of /bitnami/drupal/modules/contrib/civicrm/ext/recaptcha/lib/recaptcha/recaptchalib.php).
Expected behaviour
No error message
Environment Information
- CiviCRM: 5.40.2
- PHP: 7.3.27
- CMS: Drupal 7.82
- Database: MySQL 5.7.33
- Web Server: Apache 2.4.46
- reCAPTCHA: Version 5.40.2