From c6c2a23ecb10b4b54e7e9b703d14e8c7cda6ad55 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 5 Mar 2011 22:20:23 +0100 Subject: [PATCH] [ticket/10042] GD CAPTCHA: Round offset to the next pixel. PHPBB3-10042 --- phpBB/includes/captcha/captcha_gd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php index 96e39af85b..7a3f4f46ab 100644 --- a/phpBB/includes/captcha/captcha_gd.php +++ b/phpBB/includes/captcha/captcha_gd.php @@ -77,7 +77,7 @@ class captcha { $denom = ($code_len - $i); $denom = max(1.3, $denom); - $offset[$i] = mt_rand(0, (1.5 * $width_avail) / $denom); + $offset[$i] = mt_rand(0, (int) round((1.5 * $width_avail) / $denom)); $width_avail -= $offset[$i]; }