From eebfc3c70fcc598c9b0d9fbafb0a8a190a71c484 Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 26 Apr 2022 03:23:02 +0000 Subject: [PATCH] * Fix bug #21980. --- module/file/control.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/file/control.php b/module/file/control.php index 68b279252b..ab839b6c81 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -49,6 +49,12 @@ class file extends control public function ajaxUpload($uid = '') { $file = $this->file->getUpload('imgFile'); + + if(!isset($file[0]) or !in_array($file[0]['extension'], $this->config->file->imageExtensions)) + { + return print(json_encode(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormate))); + } + $file = $file[0]; if($file) {