From 45c63f4d118bfc99924edb8685442035349af6db Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 15 Dec 2010 12:48:56 -0800 Subject: Use mt_rand() instead of rand() since it provides better portability. Fixes #1527. --- installer/installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'installer/installer.php') 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(); -- cgit v1.2.3