Skip to content

Commit 0175908

Browse files
committed
fix generating captcha in PHP with workaround
* allows php8 working too * bcit-ci/CodeIgniter#6256
1 parent 6530fd6 commit 0175908

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

appsys/helpers/captcha_helper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,12 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path =
278278
{
279279
$theta += $thetac;
280280
$rad = $radius * ($i / $points);
281-
$x = ($rad * cos($theta)) + $x_axis;
282-
$y = ($rad * sin($theta)) + $y_axis;
281+
$x = round(($rad * cos($theta)) + $x_axis);
282+
$y = round(($rad * sin($theta)) + $y_axis);
283283
$theta += $thetac;
284284
$rad1 = $radius * (($i + 1) / $points);
285-
$x1 = ($rad1 * cos($theta)) + $x_axis;
286-
$y1 = ($rad1 * sin($theta)) + $y_axis;
285+
$x1 = round(($rad1 * cos($theta)) + $x_axis);
286+
$y1 = round(($rad1 * sin($theta)) + $y_axis);
287287
imageline($im, $x, $y, $x1, $y1, $colors['grid']);
288288
$theta -= $thetac;
289289
}

0 commit comments

Comments
 (0)