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:
copilot-swe-agent[bot] 2026-05-09 15:28:55 +00:00 committed by GitHub
parent 7e4c29edc7
commit 91ed67d2eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 16 deletions

View file

@ -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