crowdsecurity / cs-wordpress-bouncer

CrowdSec is an open-source cyber security tool. This plugin blocks detected attackers or display them a captcha to check they are not bots.
https://wordpress.org/plugins/crowdsec/
MIT License
34 stars 6 forks source link

php 8.1 (captcha) Implicit conversion from float to int loses precision #72

Closed julienloizelet closed 2 years ago

julienloizelet commented 2 years ago

With PHP 8.1, an error is thrown when a captcha wall has to be displayed. On my local environment, here is the error :

Fatal error: Uncaught ErrorException: Implicit conversion from float 20.5 to int loses precision in /var/www/html/wp-content/plugins/cs-wordpress-bouncer/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php:365 

It seems that this is due to the gregwar/captcha package:

@see https://github.com/Gregwar/Captcha/issues/100

I'm not sure that the package is still being maintained.

julienloizelet commented 2 years ago

The v0.15.0 crowdsec/bouncer release should solve the issue: https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v0.15.0 I will try to package a new version of the wordpress plugin using v0.15.0