mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-22 21:40:28 +03:00
Improve generation of CAPTCHA images
This commit is contained in:
parent
8bb1551f7a
commit
13729dac93
@ -22,8 +22,12 @@ function can_show_captcha()
|
||||
|
||||
function gen_captcha()
|
||||
{
|
||||
$md5_hash = md5(rand(0, 9999));
|
||||
return substr($md5_hash, 15, 5);
|
||||
$symbols = 'abcdefghijkmnpqrstuvwxyz123456789';
|
||||
$string = '';
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
$string .= substr($symbols, mt_rand(0, strlen($symbols)), 1);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
function draw_captcha($security_code)
|
||||
|
Loading…
Reference in New Issue
Block a user