From c304085c945870b589081b324fb7c063fd11bed4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 16 Nov 2025 19:37:46 +0100 Subject: [PATCH] fix makeRandomString() --- inc/inc.ClassUtilities.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/inc.ClassUtilities.php b/inc/inc.ClassUtilities.php index eeb853c62..f90a5069c 100644 --- a/inc/inc.ClassUtilities.php +++ b/inc/inc.ClassUtilities.php @@ -50,9 +50,10 @@ class Utilities { /* {{{ */ * @return string random string */ static public function makeRandomString($n, $alph = "0123456789abcdefghijklmnopqrstuvwxyz") { /* {{{ */ + $len = strlen($alph)-1; $s = ""; for ($i = 0; $i != $n; ++$i) - $s .= $alph[mt_rand(0, 35)]; + $s .= $alph[mt_rand(0, $len)]; return $s; } /* }}} */