diff --git a/app/captcha.php b/app/captcha.php index 038d77b..066b7ab 100644 --- a/app/captcha.php +++ b/app/captcha.php @@ -30,14 +30,15 @@ $font_size = 24; /*字体文件位置*/ $fontfile = APP_ROOT . $config['textFont']; +/* floor() 修复php>8.0精度丢失 v2.8.4 */ for ($i = 0; $i < $count; $i++) { $font_color = imagecolorallocate($img, mt_rand(0, 100), mt_rand(0, 50), mt_rand(0, 255)); imagettftext( $img, $font_size, - mt_rand(0, 20) - mt_rand(0, 25), - ($img_w * $i / 4) + mt_rand(0, 15), - mt_rand($img_h / 2, $img_h), + floor(mt_rand(0, 20) - mt_rand(0, 25)), + floor($img_w * $i / 4) + floor(mt_rand(0, 15)), + floor(mt_rand($img_h / 2, $img_h)), $font_color, realpath($fontfile), $code[$i] diff --git a/docs/update.md b/docs/update.md index 8900443..2772ab1 100644 --- a/docs/update.md +++ b/docs/update.md @@ -1,6 +1,7 @@ * 2024-01-20 v2.8.4 - Fix [#163](https://github.com/icret/EasyImages2.0/pull/163) -- 增加检测FTP +- Fix [#159](https://github.com/icret/EasyImages2.0/pull/159) +- 增加上传至FTP - 增加自定义时区 - 增加大文件分片上传 - 增加重置OPcache缓存