diff -uNr Upload/inc/functions.php work/Upload/inc/functions.php --- Upload/inc/functions.php 2010-04-13 15:54:52.000000000 +0200 +++ work/Upload/inc/functions.php 2010-04-16 01:38:24.000000000 +0200 @@ -5598,16 +5598,6 @@ $output = @fread($handle, $count); @fclose($handle); } - - // Then try the Microsoft method - if(class_exists('COM')) - { - try { - $util = new COM('CAPICOM.Utilities.1'); - $output = base64_decode($util->GetRandom($count, 0)); - } - catch(Exception $ex) { } - } } // Didn't work? Do we still not have enough bytes? Use our own (less secure) rng generator @@ -5616,7 +5606,7 @@ $output = ''; // Close to what PHP basically uses internally to seed, but not quite. - $unique_state = microtime().getmypid(); + $unique_state = microtime().@getmypid(); for($i = 0; $i < $count; $i += 16) { @@ -5642,30 +5632,21 @@ function my_rand($min=null, $max=null, $force_seed=false) { static $seeded = false; - static $obfuscator = 0; if($seeded == false || $force_seed == true) { mt_srand(secure_seed_rng()); - - // Just call it again here instead of saving extra bytes... - $obfuscator = secure_seed_rng(); - $seeded = true; } if($min !== null && $max !== null) { - $val = mt_rand($min, $max) + $obfuscator; - $val = $min + (($val - $min) % ($max+1-$min)); - return $val; + return mt_rand($min, $max); } else { - $val = mt_rand() + $obfuscator; - $val %= mt_getrandmax() + 1; - return $val; + return mt_rand(); } } -?> \ No newline at end of file +?> diff -uNr Upload/install/lock work/Upload/install/lock --- Upload/install/lock 2009-12-28 15:27:42.000000000 +0100 +++ work/Upload/install/lock 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -1 \ No newline at end of file