mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
git-svn-id: file:///svn/phpbb/trunk@6687 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
a538fb2a9e
commit
4308f5e8a5
1 changed files with 3 additions and 1 deletions
|
@ -70,6 +70,7 @@ class captcha
|
||||||
// fill with noise or grid
|
// fill with noise or grid
|
||||||
if ($config['captcha_gd_noise'])
|
if ($config['captcha_gd_noise'])
|
||||||
{
|
{
|
||||||
|
$chars_allowed = array_merge(range('1', '9'), range('A', 'Z'));
|
||||||
// random characters in background with random position, angle, color
|
// random characters in background with random position, angle, color
|
||||||
for ($i = 0 ; $i < 72; $i++)
|
for ($i = 0 ; $i < 72; $i++)
|
||||||
{
|
{
|
||||||
|
@ -78,9 +79,10 @@ class captcha
|
||||||
$x = mt_rand(0, 360);
|
$x = mt_rand(0, 360);
|
||||||
$y = mt_rand(0, (int)($this->height - ($size / 5)));
|
$y = mt_rand(0, (int)($this->height - ($size / 5)));
|
||||||
$color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224));
|
$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);
|
imagettftext($image, $size, $angle, $x, $y, $color, $this->get_font(), $text);
|
||||||
}
|
}
|
||||||
|
unset($chars_allowed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue