This was causing trouble on ppc, I kept getting the same random string (probably the passed value was too big). And "As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically." so I removed it completely.

git-svn-id: file:///svn/phpbb/trunk@5395 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann 2005-12-29 18:13:24 +00:00
parent 72b3d6ca78
commit 85f502a52b

View file

@ -123,9 +123,6 @@ function gen_rand_string($num_chars)
{ {
$chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9'); $chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9');
list($sec, $usec) = explode(' ', microtime());
mt_srand((float) $sec + ((float) $usec * 100000));
$max_chars = sizeof($chars) - 1; $max_chars = sizeof($chars) - 1;
$rand_str = ''; $rand_str = '';
for ($i = 0; $i < $num_chars; $i++) for ($i = 0; $i < $num_chars; $i++)