diff options
| author | Eliot Whalan <ewhal@pantsu.cat> | 2016-06-20 02:20:14 +0200 |
|---|---|---|
| committer | Eliot Whalan <ewhal@pantsu.cat> | 2016-06-20 02:20:14 +0200 |
| commit | 3d38c13d8d977d420bfbca5ef8e642ea5e1102e9 (patch) | |
| tree | 178ff25fa0c18b2022696b01f67c09091262ca86 /php/upload.php | |
| parent | bba43b12a16784352dbb0bf63acdef0f0c169945 (diff) | |
Use mt_rand to generate string based upon configured length
Diffstat (limited to 'php/upload.php')
| -rw-r--r-- | php/upload.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/php/upload.php b/php/upload.php index 6f764f5..a4d7a5a 100644 --- a/php/upload.php +++ b/php/upload.php @@ -45,7 +45,7 @@ function generateName($file) $chars = ID_CHARSET; $name = ''; for ($i = 0; $i < $length; ++$i) { - $name .= $chars[array_rand($chars)]; + $name .= $chars[mt_rand(0, strlen($chars))]; } // Add the extension to the file name |
