From e192fe97e5503466fe59bcd8110675362578273d Mon Sep 17 00:00:00 2001 From: tianya Date: Thu, 31 Aug 2023 08:18:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E8=84=9A=E6=9C=AC=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/system/common.func.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/system/common.func.php b/src/system/common.func.php index efb67d53..6983c969 100755 --- a/src/system/common.func.php +++ b/src/system/common.func.php @@ -112,6 +112,9 @@ function get_mime_type($filename) } $finfo = finfo_open(FILEINFO_MIME_TYPE); $mimeType = finfo_file($finfo, $filename); + if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)$#i', trim($filename))) { + return 'forbid/octet-stream'; + } finfo_close($finfo); return $mimeType; }