aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2023-01-09 20:08:58 +0100
committerDaniel Lange <DLange@git.local>2023-01-09 20:08:58 +0100
commite96f23cb83b11c3c8c1896f6fef621ed9fbaf010 (patch)
treec1aaf4571c59e29fed09f69d488e71c7913a503f
parentbc848cd41ec3da55f83a1d6676ece873cd21bc6e (diff)
downloadstikked-fit-e96f23cb83b11c3c8c1896f6fef621ed9fbaf010.tar.gz
stikked-fit-e96f23cb83b11c3c8c1896f6fef621ed9fbaf010.tar.bz2
stikked-fit-e96f23cb83b11c3c8c1896f6fef621ed9fbaf010.zip
Fix captcha_helper for PHP 8.0+ compliance
-rw-r--r--htdocs/application/helpers/captcha_helper.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/htdocs/application/helpers/captcha_helper.php b/htdocs/application/helpers/captcha_helper.php
index 9bcb132..90940e9 100644
--- a/htdocs/application/helpers/captcha_helper.php
+++ b/htdocs/application/helpers/captcha_helper.php
@@ -344,12 +344,12 @@ if (!function_exists('display_captcha')) {
for ($i = 0; $i < ($circles * $points) - 1; $i++) {
$theta = $theta + $thetac;
$rad = $radius * ($i / $points);
- $x = ($rad * cos($theta)) + $x_axis;
- $y = ($rad * sin($theta)) + $y_axis;
+ $x = (int) ($rad * cos($theta)) + $x_axis;
+ $y = (int) ($rad * sin($theta)) + $y_axis;
$theta = $theta + $thetac;
$rad1 = $radius * (($i + 1) / $points);
- $x1 = ($rad1 * cos($theta)) + $x_axis;
- $y1 = ($rad1 * sin($theta)) + $y_axis;
+ $x1 = (int) ($rad1 * cos($theta)) + $x_axis;
+ $y1 = (int) ($rad1 * sin($theta)) + $y_axis;
imageline($im, $x, $y, $x1, $y1, $grid_color);
$theta = $theta - $thetac;
}
@@ -368,21 +368,21 @@ if (!function_exists('display_captcha')) {
if ($use_font == false) {
$font_size = 5;
- $x = mt_rand(0, $img_width / ($length / 3));
+ $x = mt_rand(0, intval($img_width / ($length / 3)));
$y = 0;
} else {
$font_size = 16;
- $x = mt_rand(0, $img_width / ($length / 1.5));
+ $x = mt_rand(0, intval($img_width / ($length / 1.5)));
$y = $font_size + 2;
}
for ($i = 0; $i < strlen($word); $i++) {
if ($use_font == false) {
- $y = mt_rand(0, $img_height / 2);
+ $y = mt_rand(0, intval($img_height / 2));
imagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color);
$x += ($font_size * 2);
} else {
- $y = mt_rand($img_height / 2, $img_height - 3);
+ $y = mt_rand(intval($img_height / 2), $img_height - 3);
imagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1));
$x += $font_size;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy