fix: address code review feedback - guard billing_provision_trace, deduplicate password loop
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/ce009e66-16ae-4ca7-a28c-5dac466cc014 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
7e4c29edc7
commit
91ed67d2eb
2 changed files with 15 additions and 16 deletions
|
|
@ -23,17 +23,14 @@ function billing_generate_password(): string
|
|||
$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$len = strlen($alphabet);
|
||||
$password = '';
|
||||
try {
|
||||
for ($i = 0; $i < 6; $i++) {
|
||||
for ($i = 0; $i < 6; $i++) {
|
||||
try {
|
||||
$password .= $alphabet[random_int(0, $len - 1)];
|
||||
}
|
||||
return $password;
|
||||
} catch (Throwable $e) {
|
||||
for ($i = 0; $i < 6; $i++) {
|
||||
} catch (Throwable $e) {
|
||||
$password .= $alphabet[mt_rand(0, $len - 1)];
|
||||
}
|
||||
return $password;
|
||||
}
|
||||
return $password;
|
||||
}
|
||||
|
||||
function billing_normalize_duration(string $duration): array
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue