Better randomizer chossen (rand() does only create 32767 different numbers under...
authorRoland Häder <roland@mxchange.org>
Thu, 9 Oct 2008 16:44:36 +0000 (16:44 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 9 Oct 2008 16:44:36 +0000 (16:44 +0000)
inc/databases.php
inc/gen_sql_patches.php
inc/mails/birthday_mails.php
inc/modules/member/what-transfer.php
mailid_top.php

index 9417e4c79bbb67f7472110771fc09a0b279a642d..f8e8a8be051af15984f9534a1888ab13f0b44740 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "480");
+define('CURR_SVN_REVISION', "481");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 467e4b4ecb735cc4cfe693174516a5cd2fb8b8bf..8c54d294aa7a71699516dd038989f031b20b2d27 100644 (file)
@@ -77,7 +77,7 @@ if (empty($_CONFIG['file_hash'])) {
        if ($fp != false) {
                // Could write to secret file! So let's generate the secret key...
                // 1. Count of chars to be taken from back of the string
-               $nums = rand(40, 45);
+               $nums = mt_rand(40, 45);
                // 2. Generate secret key from a randomized string
                $secretKey = substr(generateHash(GEN_PASS(rand(128, 256))), -$nums);
                // 3. Write the key to the file
index 71a616909fae06d31aefc2e608b0a800ac51ff4c..c4dab04700104eea6215fbdf820e5e07286858fa 100644 (file)
@@ -81,7 +81,7 @@ if (SQL_NUMROWS($result_birthday) > 0) {
                        );
 
                        for ($idx = 0; $idx < 4; $idx++) {
-                               $content['check'] .= GEN_RANDOM_CODE("8", rand(0, "$MONTH$DAY"), $uid, ($AGE*($idx+1)));
+                               $content['check'] .= GEN_RANDOM_CODE("8", mt_rand(0, "$MONTH$DAY"), $uid, ($AGE*($idx+1)));
                        }
 
                        // Insert row into database
index 7e00b7a188e522c376bf255df98fb7bc5d90ce65..2b61e4b0a5440536f6a87f7fb0d7ca303dea281f 100644 (file)
@@ -181,7 +181,7 @@ case "new": // Start new transfer
                        }
 
                        // Generate tranafer id
-                       define('__TRANS_ID', bigintval(GEN_RANDOM_CODE("10", rand(0, 99999), $GLOBALS['userid'], $_POST['reason'])));
+                       define('__TRANS_ID', bigintval(GEN_RANDOM_CODE("10", mt_rand(0, 99999), $GLOBALS['userid'], $_POST['reason'])));
 
                        // Add entries to both tables
                        $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_transfers_in (userid, from_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
@@ -304,7 +304,7 @@ case "new": // Start new transfer
                // Generate Code
                if ($_CONFIG['transfer_code'] > 0)
                {
-                       $rand = rand(0, 99999);
+                       $rand = mt_rand(0, 99999);
                        $code = GEN_RANDOM_CODE($_CONFIG['transfer_code'], $rand, $GLOBALS['userid'], __TRANSFER_MAX_VALUE);
                        $img = GENERATE_IMAGE($code, false);
                        define('__TRANSFER_IMAGE_INPUT', "<INPUT type=\"hidden\" name=\"code_chk\" value=\"".$rand."\"><INPUT type=\"text\" name=\"code\" class=\"member_normal\" size=\"5\" maxlength=\"7\"".__TRANSFER_TO_DISABLED.">&nbsp;".$img);
index f2829ac315747378c7ca9d3a050d83a7eec579b6..5504788e82f76030f65c2bbdc1187be4a2f427df 100644 (file)
@@ -322,7 +322,7 @@ if (isBooleanConstantAndTrue('mxchange_installed'))
                                                                        define('_UID_VALUE' , $url_uid );
                                                                        define('_TYPE_VALUE', $type);
                                                                        define('_DATA_VALUE', $DATA);
-                                                                       define('_RAND_VALUE', rand(0, 99999));
+                                                                       define('_RAND_VALUE', mt_rand(0, 99999));
                                                                        define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true));
 
                                                                        // Load template