Vergleich captcha.php - 1.2.0 - 1.2.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: captcha.php 2148 2006-08-27 04:10:33Z Tikitiki $

 * $Id: captcha.php 3063 2007-05-15 23:53:07Z chris $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 28Zeile 28
{
$imagestring = "MyBB";
}

{
$imagestring = "MyBB";
}

else
{
$query = $db->simple_select(TABLE_PREFIX."captcha", "*", "imagehash='".$db->escape_string($mybb->input['imagehash'])."'", array("limit" => 1));

elseif($mybb->input['imagehash'])
{
$query = $db->simple_select(TABLE_PREFIX."captcha", "*", "imagehash='".$db->escape_string(strval($mybb->input['imagehash']))."'", array("limit" => 1));

	$regimage = $db->fetch_array($query);
$imagestring = $regimage['imagestring'];

	$regimage = $db->fetch_array($query);
$imagestring = $regimage['imagestring'];

 
}
else
{
return false;

}

$ttf_fonts = array();

}

$ttf_fonts = array();

Zeile 73Zeile 77
else
{
$im = imagecreate($img_width, $img_height);

else
{
$im = imagecreate($img_width, $img_height);

}

}


// No GD support, die.
if(!$im)


// No GD support, die.
if(!$im)

Zeile 139Zeile 143

/**
* Draws a random number of circles on the image.


/**
* Draws a random number of circles on the image.

 *

 *

 * @param resource The image.
*/
function draw_circles(&$im)

 * @param resource The image.
*/
function draw_circles(&$im)

Zeile 160Zeile 164

/**
* Draws a random number of dots on the image.


/**
* Draws a random number of dots on the image.

 *
* @param resource The image.

 *
* @param resource The image.

 */
function draw_dots(&$im)

 */
function draw_dots(&$im)

{

{

	global $img_width, $img_height;

$dot_count = $img_width*$img_height/5;

	global $img_width, $img_height;

$dot_count = $img_width*$img_height/5;

Zeile 183Zeile 187
function draw_squares(&$im)
{
global $img_width, $img_height;

function draw_squares(&$im)
{
global $img_width, $img_height;

	

	

	$square_count = 30;
for($i = 0; $i <= $square_count; $i++)

	$square_count = 30;
for($i = 0; $i <= $square_count; $i++)

	{

	{

		$color = imagecolorallocate($im, rand(150, 255), rand(150, 255), rand(150, 255));
$pos_x = rand(1, $img_width);
$pos_y = rand(1, $img_height);

		$color = imagecolorallocate($im, rand(150, 255), rand(150, 255), rand(150, 255));
$pos_x = rand(1, $img_width);
$pos_y = rand(1, $img_height);

Zeile 194Zeile 198
		$pos_x2 = $pos_x + $sq_height;
$pos_y2 = $pos_y + $sq_width;
imagefilledrectangle($im, $pos_x, $pos_y, $pos_x2, $pos_y2, $color);

		$pos_x2 = $pos_x + $sq_height;
$pos_y2 = $pos_y + $sq_width;
imagefilledrectangle($im, $pos_x, $pos_y, $pos_x2, $pos_y2, $color);

	}

	}

}

/**

}

/**

Zeile 206Zeile 210
function draw_string(&$im, $string)
{
global $use_ttf, $min_size, $max_size, $min_angle, $max_angle, $ttf_fonts, $img_height, $img_width;

function draw_string(&$im, $string)
{
global $use_ttf, $min_size, $max_size, $min_angle, $max_angle, $ttf_fonts, $img_height, $img_width;

 
	
if(empty($string))
{
return false;
}

	
$spacing = $img_width / my_strlen($string);
$string_length = my_strlen($string);

	
$spacing = $img_width / my_strlen($string);
$string_length = my_strlen($string);

Zeile 249Zeile 258
			$shadow_x = rand(-3, 3) + $pos_x;
$shadow_y = rand(-3, 3) + $pos_y;
$shadow_color = imagecolorallocate($im, $r+20, $g+20, $b+20);

			$shadow_x = rand(-3, 3) + $pos_x;
$shadow_y = rand(-3, 3) + $pos_y;
$shadow_color = imagecolorallocate($im, $r+20, $g+20, $b+20);

			imagefttext($im, $font_size, $rotation, $shadow_x, $shadow_y, $shadow_color, $font, $string[$i]);

			imagefttext($im, $font_size, $rotation, $shadow_x, $shadow_y, $shadow_color, $font, $string[$i], array());

			
// Write the character to the image

			
// Write the character to the image

			imagefttext($im, $font_size, $rotation, $pos_x, $pos_y, $color, $font, $string[$i]);

			imagefttext($im, $font_size, $rotation, $pos_x, $pos_y, $color, $font, $string[$i], array());

		}
else
{

		}
else
{