Harden controllers and password randomness

Co-authored-by: LeOSW42 <673670+LeOSW42@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-24 13:18:35 +00:00
parent fd29d07911
commit 0ef2679808
5 changed files with 87 additions and 28 deletions

View File

@@ -408,7 +408,7 @@ function randomPassword() {
$pass = array(); //remember to declare $pass as an array
$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
for ($i = 0; $i < 8; $i++) {
$n = rand(0, $alphaLength);
$n = random_int(0, $alphaLength);
$pass[] = $alphabet[$n];
}
return implode($pass); //turn the array into a string