【fix sonar】StrAttackFilter文件
This commit is contained in:
+2
-2
@@ -15,10 +15,10 @@ public class StrAttackFilter {
|
|||||||
|
|
||||||
public static String filter(String str) throws PatternSyntaxException {
|
public static String filter(String str) throws PatternSyntaxException {
|
||||||
// 清除掉所有特殊字符
|
// 清除掉所有特殊字符
|
||||||
String regEx = "[`_《》~!@#$%^&*()+=|{}':;',\\[\\].<>?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
|
String regEx = "[`_《》~!@#$%^&*()+=|{}':;',\\[\\].<>?";
|
||||||
|
regEx += "~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
|
||||||
Pattern p = Pattern.compile(regEx);
|
Pattern p = Pattern.compile(regEx);
|
||||||
Matcher m = p.matcher(str);
|
Matcher m = p.matcher(str);
|
||||||
return m.replaceAll("").trim();
|
return m.replaceAll("").trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user