From d63e63d986f54d6e4f4a9bec600375395796c54a Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Thu, 25 Jan 2024 18:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A8=8B=E5=BA=8F=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E3=80=91=E4=BC=98=E5=8C=96=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/setting/SystemCrud.php | 4 ++++ .../services/system/attachment/SystemAttachmentServices.php | 1 + 2 files changed, 5 insertions(+) diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemCrud.php b/crmeb/app/adminapi/controller/v1/setting/SystemCrud.php index 6f5fe361c..cffca2026 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemCrud.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemCrud.php @@ -85,6 +85,10 @@ class SystemCrud extends AuthController ['deleteField', []],//删除的表字段 ]); + if (!preg_match('/^[\x{4e00}-\x{9fa5}a-zA-Z]+$/u', $data['menuName'])) return app('json')->fail('菜单名称只能是中文或者英文'); + if (!preg_match('/^[\x{4e00}-\x{9fa5}a-zA-Z]+$/u', $data['modelName'])) return app('json')->fail('模块名称只能是中文或者英文'); + if (!preg_match('/^[a-zA-Z_]+$/u', $data['tableName'])) return app('json')->fail('表名称只能是英文和下划线组成'); + $fromField = $searchField = $hasOneField = $columnField = $tableIndex = []; $dictionaryids = array_column($data['tableField'], 'dictionary_id'); diff --git a/crmeb/app/services/system/attachment/SystemAttachmentServices.php b/crmeb/app/services/system/attachment/SystemAttachmentServices.php index c8e65aeb5..00735a574 100644 --- a/crmeb/app/services/system/attachment/SystemAttachmentServices.php +++ b/crmeb/app/services/system/attachment/SystemAttachmentServices.php @@ -256,6 +256,7 @@ class SystemAttachmentServices extends BaseServices if (isset($pathinfo['extension']) && !in_array($pathinfo['extension'], ['avi', 'mp4', 'wmv', 'rm', 'mpg', 'mpeg', 'mov', 'flv', 'swf'])) { throw new AdminException(400558); } + $data['chunkNumber'] = (int)$data['chunkNumber']; $public_dir = app()->getRootPath() . 'public'; $dir = '/uploads/attach/' . date('Y') . DIRECTORY_SEPARATOR . date('m') . DIRECTORY_SEPARATOR . date('d'); $all_dir = $public_dir . $dir;