Index: trunk/core/units/general/helpers/captcha_helper.php =================================================================== diff -u -N -r7391 -r8796 --- trunk/core/units/general/helpers/captcha_helper.php (.../captcha_helper.php) (revision 7391) +++ trunk/core/units/general/helpers/captcha_helper.php (.../captcha_helper.php) (revision 8796) @@ -2,22 +2,23 @@ class kCaptchaHelper extends kHelper { + var $width; + var $height; + function GenerateCaptchaCode($len = 5) { - $chars = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - $s = ''; - for ($i = 0; $i < $len; $i++) { - $s .= $chars[ rand(0, strlen($chars)-1) ]; - } - return $s; + $chars = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $s = ''; + for ($i = 0; $i < $len; $i++) { + $s .= $chars[ rand(0, strlen($chars)-1) ]; + } + return $s; } - var $width; - var $height; - - function graphics($w, $h) { - $this->width = $w; - $this->height = $h; + function graphics($w, $h) + { + $this->width = $w; + $this->height = $h; } function GenerateCaptchaImage($rand, $width, $height, $filter_blur = false) @@ -46,8 +47,8 @@ imagettftext($image, $height*0.75, 0, floor(($width - $dimensions[4])/2), floor(($height - $dimensions[5])/2), $textColor, KERNEL_PATH.'/fonts/monofont.ttf', $rand); -// $font = imageloadfont(KERNEL_PATH.'/fonts/monofont.ttf'); -// imagestring($image, $font, 3, 0, $rand, $textColor); + // $font = imageloadfont(KERNEL_PATH.'/fonts/monofont.ttf'); + // imagestring($image, $font, 3, 0, $rand, $textColor); if ($filter_blur) $this->blur($image, 3); @@ -72,7 +73,8 @@ imagedestroy($image); } - function blur(&$gdimg, $radius = 5.0) { + function blur(&$gdimg, $radius = 5.0) + { // Taken from Torstein H�nsi's phpUnsharpMask (see phpthumb.unsharp.php) $radius = round(max(0, min($radius, 50)) * 2);