Procházet zdrojové kódy

优化匹配方式

RuoYi před 2 roky
rodič
revize
2dca6f0a12

+ 1 - 1
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/GenConstants.java

@@ -42,7 +42,7 @@ public class GenConstants
42 42
 
43 43
     /** 数据库数字类型 */
44 44
     public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
45
-            "bigint", "float", "double", "decimal" };
45
+            "bit", "bigint", "float", "double", "decimal" };
46 46
 
47 47
     /** 页面不需要编辑字段 */
48 48
     public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };

+ 6 - 1
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/xss/XssValidator.java

@@ -27,8 +27,13 @@ public class XssValidator implements ConstraintValidator<Xss, String>
27 27
 
28 28
     public static boolean containsHtml(String value)
29 29
     {
30
+        StringBuilder sHtml = new StringBuilder();
30 31
         Pattern pattern = Pattern.compile(HTML_PATTERN);
31 32
         Matcher matcher = pattern.matcher(value);
32
-        return matcher.matches();
33
+        while (matcher.find())
34
+        {
35
+            sHtml.append(matcher.group());
36
+        }
37
+        return pattern.matcher(sHtml).matches();
33 38
     }
34 39
 }