Skip to content

Commit 70d0a0e

Browse files
authored
Merge pull request #6256 from Khuthaily/patch-2
fix generating captcha in PHP 8.1
2 parents ae7b30f + c0b8c6e commit 70d0a0e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

system/helpers/captcha_helper.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ function create_captcha($data)
297297
{
298298
$theta += $thetac;
299299
$rad = $radius * ($i / $points);
300-
$x = ($rad * cos($theta)) + $x_axis;
301-
$y = ($rad * sin($theta)) + $y_axis;
300+
$x = round(($rad * cos($theta)) + $x_axis);
301+
$y = round(($rad * sin($theta)) + $y_axis);
302302
$theta += $thetac;
303303
$rad1 = $radius * (($i + 1) / $points);
304-
$x1 = ($rad1 * cos($theta)) + $x_axis;
305-
$y1 = ($rad1 * sin($theta)) + $y_axis;
304+
$x1 = round(($rad1 * cos($theta)) + $x_axis);
305+
$y1 = round(($rad1 * sin($theta)) + $y_axis);
306306
imageline($im, $x, $y, $x1, $y1, $colors['grid']);
307307
$theta -= $thetac;
308308
}

0 commit comments

Comments
 (0)