From 6c4a41cc694b89064a64fa63d064ca14df436038 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 16 Apr 2026 14:53:48 -0600 Subject: [PATCH] Change default password length to 20 Updated the default length for password generation from 0 to 20 in the generate_password function. --- resources/functions.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index ae4ddd5ed..3dab7f19b 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -1299,14 +1299,13 @@ function tail(string $file, int $num_to_get = 10): string { return $ret; } -//generate a random password with upper, lowercase and symbols /** * Generates a random password of specified length and strength. * - * @param int $length The desired length of the password. Defaults to 0 if not provided. + * @param int $length The desired length of the password. Defaults to 20 if not provided. * @param int $strength The desired strength level of the password. * This defaults to 3 if not provided. The higher level includes the previous levels. - * If the password_strength was set to 3, this would include numeric, lowercase, and uppercase letters. + * If the password_strength were set to 3, this would include numeric, lowercase, and uppercase letters. * - Level 1: Numeric * - Level 2: Lowercase letters * - Level 3: Uppercase letters @@ -1315,7 +1314,7 @@ function tail(string $file, int $num_to_get = 10): string { * @return string The generated password. * @throws \Random\RandomException */ -function generate_password(int $length = 0, int $strength = 3): string { +function generate_password(int $length = 20, int $strength = 3): string { //define the global variables global $settings;