summaryrefslogtreecommitdiff
path: root/installer/installer.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-12-15 12:48:56 -0800
committerBharat Mediratta <bharat@menalto.com>2010-12-15 12:48:56 -0800
commit45c63f4d118bfc99924edb8685442035349af6db (patch)
tree995e248347743f905d7c8fc29343e88d74b31441 /installer/installer.php
parent6fb0eb4e97e3bbfa50029f0b4249c10bd22abe09 (diff)
Use mt_rand() instead of rand() since it provides better portability.
Fixes #1527.
Diffstat (limited to 'installer/installer.php')
-rw-r--r--installer/installer.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/installer/installer.php b/installer/installer.php
index 9a957b43..7d358e70 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -138,7 +138,7 @@ class installer {
$char += ($char > 90) ? 13 : ($char > 57) ? 7 : 0;
$salt .= chr($char);
}
- $password = substr(md5(time() * rand()), 0, 6);
+ $password = substr(md5(time() . mt_rand()), 0, 6);
// Escape backslash in preparation for our UPDATE statement.
$hashed_password = str_replace("\\", "\\\\", $salt . md5($salt . $password));
$sql = self::prepend_prefix($config["prefix"],
@@ -152,7 +152,7 @@ class installer {
}
static function create_admin_session($config) {
- $session_id = md5(time() * rand());
+ $session_id = md5(time() . mt_rand());
$user_agent = $_SERVER["HTTP_USER_AGENT"];
$user_agent_len = strlen($user_agent);
$now = time();