1
This commit is contained in:
21
app/admin/model/SystemConfig.php
Normal file
21
app/admin/model/SystemConfig.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\TimeModel;
|
||||
use think\Model;
|
||||
|
||||
class SystemConfig extends TimeModel
|
||||
{
|
||||
public static function onBeforeUpdate(Model $model): void
|
||||
{
|
||||
if ($model->getData('name') === 'upload_allow_ext') {
|
||||
//去除 php
|
||||
$model->value = implode(',',array_map(function ($ext) {
|
||||
return trim(strtolower($ext), ' ');
|
||||
}, array_filter(explode(',', $model->getData('value')), function ($ext) {
|
||||
return strtolower(trim($ext)) !== 'php';
|
||||
})));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user