mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
*** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6282 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
edb40a59aa
commit
38397c58fa
1 changed files with 12 additions and 30 deletions
|
@ -1107,6 +1107,7 @@ class captcha
|
||||||
*/
|
*/
|
||||||
function noise_line($img, $min_x, $min_y, $max_x, $max_y, $bg, $font, $non_font)
|
function noise_line($img, $min_x, $min_y, $max_x, $max_y, $bg, $font, $non_font)
|
||||||
{
|
{
|
||||||
|
imagesetthickness($img, 2);
|
||||||
$x1 = $min_x;
|
$x1 = $min_x;
|
||||||
$x2 = $max_x;
|
$x2 = $max_x;
|
||||||
$y1 = $min_y;
|
$y1 = $min_y;
|
||||||
|
@ -1114,23 +1115,13 @@ class captcha
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
$line = array();
|
$line = array_merge(
|
||||||
|
array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]),
|
||||||
for ($j = mt_rand(30, 60); $j > 0; --$j)
|
array_fill(0, mt_rand(30, 60), $bg)
|
||||||
{
|
);
|
||||||
$line[] = $non_font[array_rand($non_font)];
|
|
||||||
}
|
|
||||||
|
|
||||||
for ($j = mt_rand(30, 60); $j > 0; --$j)
|
|
||||||
{
|
|
||||||
$line[] = $bg;
|
|
||||||
}
|
|
||||||
|
|
||||||
imagesetstyle($img, $line);
|
imagesetstyle($img, $line);
|
||||||
for ($yp = -1; $yp <= 1; ++$yp)
|
imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
|
||||||
{
|
|
||||||
imageline($img, $x1, $y1 + $yp, $x2, $y2 + $yp, IMG_COLOR_STYLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
$y1 += mt_rand(12, 35);
|
$y1 += mt_rand(12, 35);
|
||||||
$y2 += mt_rand(12, 35);
|
$y2 += mt_rand(12, 35);
|
||||||
|
@ -1144,28 +1135,19 @@ class captcha
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
$line = array();
|
$line = array_merge(
|
||||||
|
array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]),
|
||||||
for ($j = mt_rand(30, 60); $j > 0; --$j)
|
array_fill(0, mt_rand(30, 60), $bg)
|
||||||
{
|
);
|
||||||
$line[] = $non_font[array_rand($non_font)];
|
|
||||||
}
|
|
||||||
|
|
||||||
for ($j = mt_rand(30, 60); $j > 0; --$j)
|
|
||||||
{
|
|
||||||
$line[] = $bg;
|
|
||||||
}
|
|
||||||
|
|
||||||
imagesetstyle($img, $line);
|
imagesetstyle($img, $line);
|
||||||
for ($xp = -1; $xp <= 1; ++$xp)
|
imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
|
||||||
{
|
|
||||||
imageline($img, $x1 + $xp, $y1, $x2 + $xp, $y2, IMG_COLOR_STYLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
$x1 += mt_rand(12, 35);
|
$x1 += mt_rand(12, 35);
|
||||||
$x2 += mt_rand(12, 35);
|
$x2 += mt_rand(12, 35);
|
||||||
}
|
}
|
||||||
while ($x1 < $max_x && $x2 < $max_x);
|
while ($x1 < $max_x && $x2 < $max_x);
|
||||||
|
imagesetthickness($img, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue