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