0001-Use-array-access-for-single-character-instead-of-sub.patch

Chris Bandy, 05/14/2009 09:12 am

Download (856 Bytes)

 
system/libraries/drivers/Captcha/Alpha.php (working copy)
81 81

  
82 82
			// Draw "ghost" alphabetic character
83 83
			$text_color = imagecolorallocatealpha($this->image, mt_rand($color_limit + 8, 255), mt_rand($color_limit + 8, 255), mt_rand($color_limit + 8, 255), mt_rand(70, 120));
84
			$char = substr($chars, mt_rand(0, 14), 1);
84
			$char = $chars[mt_rand(0, 14)];
85 85
			imagettftext($this->image, $size * 2, mt_rand(-45, 45), ($x - (mt_rand(5, 10))), ($y + (mt_rand(5, 10))), $text_color, $font, $char);
86 86
		}
87 87