diff options
author | David M <davidmj@users.sourceforge.net> | 2006-11-28 13:44:21 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-11-28 13:44:21 +0000 |
commit | 4308f5e8a5094887789ae1bf1d2ac37ba9410eb0 (patch) | |
tree | 400e835f2bc48ffc15793dcc8a011ed64136732f /phpBB/includes | |
parent | a538fb2a9e1ef01a9bf2b1d1c462f74eae1309a5 (diff) | |
download | forums-4308f5e8a5094887789ae1bf1d2ac37ba9410eb0.tar forums-4308f5e8a5094887789ae1bf1d2ac37ba9410eb0.tar.gz forums-4308f5e8a5094887789ae1bf1d2ac37ba9410eb0.tar.bz2 forums-4308f5e8a5094887789ae1bf1d2ac37ba9410eb0.tar.xz forums-4308f5e8a5094887789ae1bf1d2ac37ba9410eb0.zip |
#5672
git-svn-id: file:///svn/phpbb/trunk@6687 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/captcha/captcha_gd.php | 4 |
1 files changed, 3 insertions, 1 deletions
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 { |