mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改文件上传配置
This commit is contained in:
parent
9adad7e15f
commit
84bd116e8c
@ -92,11 +92,9 @@ class Config extends Controller
|
|||||||
} else {
|
} else {
|
||||||
$post = $this->request->post();
|
$post = $this->request->post();
|
||||||
if (!empty($post['storage']['allow_exts'])) {
|
if (!empty($post['storage']['allow_exts'])) {
|
||||||
|
$deny = ['sh', 'asp', 'bat', 'cmd', 'exe', 'php'];
|
||||||
$exts = array_unique(str2arr(strtolower($post['storage']['allow_exts'])));
|
$exts = array_unique(str2arr(strtolower($post['storage']['allow_exts'])));
|
||||||
foreach (['sh', 'asp', 'bat', 'cmd', 'exe', 'php'] as $ext) {
|
if (array_intersect($deny, $exts)) $this->error('禁止上传可执行的文件!');
|
||||||
if (in_array($ext, $exts)) $this->error('禁止上传可执行的文件!');
|
|
||||||
}
|
|
||||||
sort($exts);
|
|
||||||
$post['storage']['allow_exts'] = join(',', $exts);
|
$post['storage']['allow_exts'] = join(',', $exts);
|
||||||
}
|
}
|
||||||
foreach ($post as $name => $value) sysconf($name, $value);
|
foreach ($post as $name => $value) sysconf($name, $value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user