aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/captcha/captcha_gd.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-08-12 18:26:54 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-08-12 18:26:54 +0000
commit38397c58fa0654b9ccb6387a0492ce6ba11547c6 (patch)
treeabef4bc1595a5d3566ba64fdf2ea99e22d21bb0c /phpBB/includes/captcha/captcha_gd.php
parentedb40a59aab9d25c8430142dc85aee7e478775b2 (diff)
downloadforums-38397c58fa0654b9ccb6387a0492ce6ba11547c6.tar
forums-38397c58fa0654b9ccb6387a0492ce6ba11547c6.tar.gz
forums-38397c58fa0654b9ccb6387a0492ce6ba11547c6.tar.bz2
forums-38397c58fa0654b9ccb6387a0492ce6ba11547c6.tar.xz
forums-38397c58fa0654b9ccb6387a0492ce6ba11547c6.zip
*** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6282 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/captcha/captcha_gd.php')
-rw-r--r--phpBB/includes/captcha/captcha_gd.php42
1 files changed, 12 insertions, 30 deletions
diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php
index 2615e19d37..3939204181 100644
--- a/phpBB/includes/captcha/captcha_gd.php
+++ b/phpBB/includes/captcha/captcha_gd.php
@@ -1107,6 +1107,7 @@ class captcha
*/
function noise_line($img, $min_x, $min_y, $max_x, $max_y, $bg, $font, $non_font)
{
+ imagesetthickness($img, 2);
$x1 = $min_x;
$x2 = $max_x;
$y1 = $min_y;
@@ -1114,23 +1115,13 @@ class captcha
do
{
- $line = array();
-
- for ($j = mt_rand(30, 60); $j > 0; --$j)
- {
- $line[] = $non_font[array_rand($non_font)];
- }
-
- for ($j = mt_rand(30, 60); $j > 0; --$j)
- {
- $line[] = $bg;
- }
+ $line = array_merge(
+ array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]),
+ array_fill(0, mt_rand(30, 60), $bg)
+ );
imagesetstyle($img, $line);
- for ($yp = -1; $yp <= 1; ++$yp)
- {
- imageline($img, $x1, $y1 + $yp, $x2, $y2 + $yp, IMG_COLOR_STYLED);
- }
+ imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
$y1 += mt_rand(12, 35);
$y2 += mt_rand(12, 35);
@@ -1144,28 +1135,19 @@ class captcha
do
{
- $line = array();
-
- for ($j = mt_rand(30, 60); $j > 0; --$j)
- {
- $line[] = $non_font[array_rand($non_font)];
- }
-
- for ($j = mt_rand(30, 60); $j > 0; --$j)
- {
- $line[] = $bg;
- }
+ $line = array_merge(
+ array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]),
+ array_fill(0, mt_rand(30, 60), $bg)
+ );
imagesetstyle($img, $line);
- for ($xp = -1; $xp <= 1; ++$xp)
- {
- imageline($img, $x1 + $xp, $y1, $x2 + $xp, $y2, IMG_COLOR_STYLED);
- }
+ imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
$x1 += mt_rand(12, 35);
$x2 += mt_rand(12, 35);
}
while ($x1 < $max_x && $x2 < $max_x);
+ imagesetthickness($img, 1);
}
/**