Meteo-Concept / hcaptcha-bundle

A Symfony 4+ bundle to bring hCaptcha into your forms
Other
22 stars 10 forks source link

HCaptchaBundle unhandled deprecation ErrorException warning #14

Closed rolnavcn closed 11 months ago

rolnavcn commented 11 months ago

The newest version of HCaptchaBundle (v3.4.0) passes NULL values to urlencode() in \MeteoConcept\HCaptchaBundle\Service\HCaptchaVerifier::verify. Passing NULL values to urlencode() is deprecated and results in an unhandled ErrorException warning.

lgeorget commented 11 months ago

Thank you for the report. I think this error only occurs if the HCaptchaValue is not properly filled-in though so it shouldn't be too much of a problem in normal circumstances since this is a misuse of the HCaptchaVerifier verify() method anyway.

I believe it's fixed in release https://github.com/Meteo-Concept/hcaptcha-bundle/releases/tag/v3.5.0. It's lacking a non-regression test though. #TODO

rolnavcn commented 11 months ago

It occurred because we pass a NULL value to the $remoteIp property of HCaptchaResponse constructor, since its not necessary.

Thank you for a fast fix!