Captcha
Captcha copied to clipboard
PHP Deprecated: Implicit conversion from float -- to int loses precision in CaptchaBuilder.php on line 365
Not sure this is still being maintained, but after I upgraded my PHP version to 8.1 I am seeing this error message.
PHP Deprecated: Implicit conversion from float 42.5 to int loses precision in CaptchaBuilder.php on line 365 PHP Deprecated: Implicit conversion from float 3.3333333333333335 to int loses precision in CaptchaBuilder.php on line 608
Seems to be related to:
https://php.watch/versions/8.1/deprecate-implicit-conversion-incompatible-float-string
See #98
IMHO better fix #101
I actually had to make changes in 2 places:
CaptchaBuilder.php
365: \imagettftext($image, $size, $angle, round($x), round($y)+ $offset, $col, $font, $symbol);
608: $value = mt_rand(round($min), round($max));
casting as an int would probably work also. Is there going to be an update or should I create my own fork ?
@sscotti This has been fixed in the latest release 1.2.1