Skip to content

fix type error on recaptcha validation

JonGold requested to merge JonGold/formprotection:recaptcha-type-error into main

There's no security implication here, but this keeps the logs much cleaner.

If a request is submitted that should have the ReCAPTCHA param, but doesn't, then \Civi\Formprotection\Recaptcha::validate() causes a fatal error because we're passing NULL as the first argument, which must be a string.

This changes our 500 errors to 400 errors, which don't clog up the PHP or webserver logs.

Merge request reports