Browse Source

优化移动端弹窗大小判断

优化上传文件名过滤
Karson 3 years ago
parent
commit
d785d321f7

+ 1 - 0
application/common/library/Upload.php

@@ -181,6 +181,7 @@ class Upload
             $suffix = $this->fileInfo['suffix'];
         }
         $filename = $filename ? $filename : ($suffix ? substr($this->fileInfo['name'], 0, strripos($this->fileInfo['name'], '.')) : $this->fileInfo['name']);
+        $filename = xss_clean(strip_tags(htmlspecialchars($filename)));
         $md5 = $md5 ? $md5 : md5_file($this->fileInfo['tmp_name']);
         $replaceArr = [
             '{year}'     => date("Y"),

+ 1 - 1
application/config.php

@@ -292,7 +292,7 @@ return [
         //允许跨域的域名,多个以,分隔
         'cors_request_domain'   => 'localhost,127.0.0.1',
         //版本号
-        'version'               => '1.3.1.20220112',
+        'version'               => '1.3.2.20220113',
         //API接口地址
         'api_url'               => 'https://api.fastadmin.net',
     ],

+ 1 - 1
bower.json

@@ -7,7 +7,7 @@
   "private": true,
   "dependencies": {
     "jquery": "^2.1.4",
-    "bootstrap": "~3.3.7",
+    "bootstrap": "^3.3.7",
     "font-awesome": "^4.6.1",
     "bootstrap-table": "fastadmin-bootstraptable#~1.11.5",
     "jstree": "~3.3.2",

+ 7 - 2
public/assets/js/fast.js

@@ -187,8 +187,13 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
                     }
                 }, options ? options : {});
                 if ($(window).width() < 480 || (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream && top.$(".tab-pane.active").size() > 0)) {
-                    options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
-                    options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
+                    if (top.$(".tab-pane.active").length > 0) {
+                        options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
+                        options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
+                    } else {
+                        options.area = [$(window).width() + "px", $(window).height() + "px"];
+                        options.offset = ["0px", "0px"];
+                    }
                 }
                 return Layer.open(options);
             },

+ 7 - 2
public/assets/js/require-backend.min.js

@@ -845,8 +845,13 @@ define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, u
                     }
                 }, options ? options : {});
                 if ($(window).width() < 480 || (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream && top.$(".tab-pane.active").size() > 0)) {
-                    options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
-                    options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
+                    if (top.$(".tab-pane.active").length > 0) {
+                        options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
+                        options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
+                    } else {
+                        options.area = [$(window).width() + "px", $(window).height() + "px"];
+                        options.offset = ["0px", "0px"];
+                    }
                 }
                 return Layer.open(options);
             },

+ 7 - 2
public/assets/js/require-frontend.min.js

@@ -838,8 +838,13 @@ define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, u
                     }
                 }, options ? options : {});
                 if ($(window).width() < 480 || (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream && top.$(".tab-pane.active").size() > 0)) {
-                    options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
-                    options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
+                    if (top.$(".tab-pane.active").length > 0) {
+                        options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
+                        options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
+                    } else {
+                        options.area = [$(window).width() + "px", $(window).height() + "px"];
+                        options.offset = ["0px", "0px"];
+                    }
                 }
                 return Layer.open(options);
             },