浏览代码

Update AttachmentController.class.php

star7th 4 年之前
父节点
当前提交
0412809a51
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      server/Application/Api/Controller/AttachmentController.class.php

+ 3 - 2
server/Application/Api/Controller/AttachmentController.class.php

@@ -71,7 +71,7 @@ class AttachmentController extends BaseController {
            return false;
         }
         
-        if (strstr(strip_tags(strtolower($_FILES['editormd-image-file']['name'])), ".php") ) {
+        if (strstr(strip_tags(strtolower($_FILES['editormd-image-file']['name'])), ".php") || strstr(strip_tags(strtolower($_FILES['editormd-image-file']['name'])), ".htm") ) {
             return false;
         }
 
@@ -101,7 +101,8 @@ class AttachmentController extends BaseController {
            return false;
         }
         
-        if (strstr(strip_tags(strtolower($uploadFile['name'])), ".php") ) {
+        if (strstr(strip_tags(strtolower($uploadFile['name'])), ".php") || strstr(strip_tags(strtolower($uploadFile['name'])), ".htm") ) {
+            $this->sendError(10100,'不支持此文件类型');
             return false;
         }