|
@@ -657,7 +657,7 @@ if (!function_exists('get_random_code')) {
|
|
|
*/
|
|
*/
|
|
|
function get_random_code($length = 8, $prefix = '', $ext = '')
|
|
function get_random_code($length = 8, $prefix = '', $ext = '')
|
|
|
{
|
|
{
|
|
|
- $length = $length < 9 ? 9 : $length;
|
|
|
|
|
|
|
+ $length = $length < 8 ? 8 : $length;
|
|
|
$code = strtoupper(md5(uniqid(mt_rand(), true) . $ext . microtime()));
|
|
$code = strtoupper(md5(uniqid(mt_rand(), true) . $ext . microtime()));
|
|
|
$start = rand(1, strlen($code) - $length);
|
|
$start = rand(1, strlen($code) - $length);
|
|
|
return $prefix . mb_substr($code, $start, $length);
|
|
return $prefix . mb_substr($code, $start, $length);
|