mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 15:27:42 +02:00
[ticket/9780] Add length check back to gen_rand_string().
PHPBB3-9780
This commit is contained in:
committed by
Andreas Fischer
parent
0ee49ca432
commit
d533121741
@@ -201,7 +201,7 @@ function set_config_count($config_name, $increment, $is_dynamic = false)
|
|||||||
function gen_rand_string($num_chars = 8)
|
function gen_rand_string($num_chars = 8)
|
||||||
{
|
{
|
||||||
// [a, z] + [0, 9] = 36
|
// [a, z] + [0, 9] = 36
|
||||||
return strtoupper(base_convert(unique_id(), 16, 36));
|
return substr(strtoupper(base_convert(unique_id(), 16, 36)), 0, $num_chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user