From 4308f5e8a5094887789ae1bf1d2ac37ba9410eb0 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 28 Nov 2006 13:44:21 +0000 Subject: #5672 git-svn-id: file:///svn/phpbb/trunk@6687 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/captcha/captcha_gd.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php index 10c61836a5..3d64cb1c26 100644 --- a/phpBB/includes/captcha/captcha_gd.php +++ b/phpBB/includes/captcha/captcha_gd.php @@ -70,6 +70,7 @@ class captcha // fill with noise or grid if ($config['captcha_gd_noise']) { + $chars_allowed = array_merge(range('1', '9'), range('A', 'Z')); // random characters in background with random position, angle, color for ($i = 0 ; $i < 72; $i++) { @@ -78,9 +79,10 @@ class captcha $x = mt_rand(0, 360); $y = mt_rand(0, (int)($this->height - ($size / 5))); $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); - $text = chr(mt_rand(45, 250)); + $text = $chars_allowed[array_rand($chars_allowed)]; imagettftext($image, $size, $angle, $x, $y, $color, $this->get_font(), $text); } + unset($chars_allowed); } else { -- cgit v1.2.1