From 19ef2d9fc9cd7207bbd6958544f88ebdcb5f2022 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 29 Mar 2016 14:25:24 +0200 Subject: [PATCH] Better use mt_rand() as it produces better random numbers. --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index a75b12c..a8410f2 100644 --- a/index.php +++ b/index.php @@ -106,7 +106,7 @@ // 'User ID' if (!isset($_SESSION['upload_user_id'])) - $_SESSION['upload_user_id'] = rand(100000, 999999); + $_SESSION['upload_user_id'] = mt_rand(100000, 999999); // List of filenames that were uploaded by this user if (!isset($_SESSION['upload_user_files'])) @@ -171,7 +171,7 @@ do { $file_data['target_file_name'] = ''; while (strlen($file_data['target_file_name']) < $settings['random_name_len']) - $file_data['target_file_name'] .= $settings['random_name_alphabet'][rand(0, strlen($settings['random_name_alphabet']) - 1)]; + $file_data['target_file_name'] .= $settings['random_name_alphabet'][mt_rand(0, strlen($settings['random_name_alphabet']) - 1)]; if ($settings['random_name_keep_type']) $file_data['target_file_name'] .= '.' . pathinfo($file_data['uploaded_file_name'], PATHINFO_EXTENSION); } while (file_exists($file_data['target_file_name'])); -- 2.39.5