Browse Source

Update AttachmentController.class.php

star7th 4 years ago
parent
commit
0412809a51
1 changed files with 3 additions and 2 deletions
  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;
         }