|
楼主 |
发表于 2016-12-5 16:48:44
|
显示全部楼层
本帖最后由 nenuwangd· 于 2016-12-5 16:51 编辑
上次谢谢你帮我回答问题。我用的ci版本是2.2.6。if (empty($word))
{
$word = '';
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$pool_length = strlen($pool);
$rand_max = $pool_length - 1;
// PHP7 or a suitable polyfill
if (function_exists('random_int'))
{
try
{
for ($i = 0; $i < $word_length; $i++)
{
$word .= $pool[random_int(0, $rand_max)];
}
}
catch (Exception $e)
{
// This means fallback to the next possible
// alternative to random_int()
$word = '';
}
}
}
我看了下captcha_helper.php文件,里面没有定义$word_length,如果我直接给$word_length赋值,就会出错
|
|