From fca26fcd9b8fcdf81721319772406eacf2b3c701 Mon Sep 17 00:00:00 2001 From: Nick Mispoulier Date: Wed, 17 Apr 2024 12:27:51 +0200 Subject: [PATCH] Merge pull request #6256 from Khuthaily/patch-2 fix generating captcha in PHP 8.1 --- system/helpers/captcha_helper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 9fcbd1b2d78..c7feeac3418 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -278,12 +278,12 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = { $theta += $thetac; $rad = $radius * ($i / $points); - $x = ($rad * cos($theta)) + $x_axis; - $y = ($rad * sin($theta)) + $y_axis; + $x = round(($rad * cos($theta)) + $x_axis); + $y = round(($rad * sin($theta)) + $y_axis); $theta += $thetac; $rad1 = $radius * (($i + 1) / $points); - $x1 = ($rad1 * cos($theta)) + $x_axis; - $y1 = ($rad1 * sin($theta)) + $y_axis; + $x1 = round(($rad1 * cos($theta)) + $x_axis); + $y1 = round(($rad1 * sin($theta)) + $y_axis); imageline($im, $x, $y, $x1, $y1, $colors['grid']); $theta -= $thetac; }