文件上传rand超出范围

feat/task1-c-wallet
devil_gong 2019-01-09 10:49:57 +08:00
parent bd0b6934cb
commit 201109bbc3
1 changed files with 1 additions and 1 deletions

View File

@ -311,7 +311,7 @@ class Uploader
$format = str_replace("{filename}", $oriName, $format);
//替换随机字符串
$randNum = rand(1, 10000000000) . rand(1, 10000000000);
$randNum = rand(1, 1000) . rand(1, 1000) . rand(1, 1000);
if (preg_match("/\{rand\:([\d]*)\}/i", $format, $matches)) {
$format = preg_replace("/\{rand\:[\d]*\}/i", substr($randNum, 0, $matches[1]), $format);
}