文件上传rand超出范围
parent
bd0b6934cb
commit
201109bbc3
|
|
@ -311,7 +311,7 @@ class Uploader
|
||||||
$format = str_replace("{filename}", $oriName, $format);
|
$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)) {
|
if (preg_match("/\{rand\:([\d]*)\}/i", $format, $matches)) {
|
||||||
$format = preg_replace("/\{rand\:[\d]*\}/i", substr($randNum, 0, $matches[1]), $format);
|
$format = preg_replace("/\{rand\:[\d]*\}/i", substr($randNum, 0, $matches[1]), $format);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue