Update ticket.lib.php

This commit is contained in:
Laurent Destailleur 2025-12-01 13:20:45 +01:00 committed by GitHub
parent 4a96baed9b
commit 47aa1b4001
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -230,11 +230,9 @@ function generate_random_id($car = 16)
for ($i = 0; $i < $car; $i++) {
try {
// Cela ne dépend PAS de microtime() et ne nécessite pas de srand/seed.
$key = random_int(0, $max);
} catch (\Exception $e) {
// Fallback de secours extrême si la source d'entropie système est illisible
// On laisse PHP gérer le seeding automatiquement ici (plus de mt_srand manuel)
// Fallback. We let PHP makes the seed automatically (no manual mt_srand)
$key = mt_rand(0, $max);
}
$string .= $chaine[$key];