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; } /* }}} */