修复配置导入错误IsHex值不校验BUG

复现条件:填写错误IsHex值,不填写Is Case-sensitive
This commit is contained in:
zhangwenqing
2019-03-22 18:21:25 +08:00
parent fc302fe984
commit 253adc1396
3 changed files with 115 additions and 112 deletions

View File

@@ -381,45 +381,46 @@ public class CheckComplexStringFormatThread implements Callable<String>{
prop.getProperty("is_case_insenstive")) + ";");
}
}
} else {
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.equals("1") && isHex.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
// 关键字十六进制校验
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
if(!bl) {
errInfo.append(
prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
}
}
}
isHex = baseStringCfg.getIsHex();
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.equals("1") && isHex.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
// 关键字十六进制校验
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
if(!bl) {
errInfo.append(
prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
}
}
if (isHex != null && isCaseInsenstive != null) {
if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) {
baseStringCfg.setIsHexbin(0);

View File

@@ -437,49 +437,50 @@ public class CheckStringFormatThread implements Callable<String>{
prop.getProperty("is_case_insenstive")) + ";");
}
}
} else {
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.equals("1") && isHex.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
// 十六进制 关键字校验
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
if(!bl) {
String message = prop.getProperty("key_word");
if(regionDict.getFunctionId().equals(403) || regionDict.getFunctionId().equals(200)) {
message = prop.getProperty("domain_name");
}
errInfo.append(
message + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
}
}
}
isHex = baseStringCfg.getIsHex();
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.equals("1") && isHex.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
// 十六进制 关键字校验
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
if(!bl) {
String message = prop.getProperty("key_word");
if(regionDict.getFunctionId().equals(403) || regionDict.getFunctionId().equals(200)) {
message = prop.getProperty("domain_name");
}
errInfo.append(
message + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
}
}
if (isHex != null && isCaseInsenstive != null) {
if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) {
baseStringCfg.setIsHexbin(0);

View File

@@ -254,45 +254,46 @@ public class CheckTopicWebsiteFormatThread implements Callable<String>{
prop.getProperty("is_case_insenstive")) + ";");
}
}
} else {
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.equals("1") && isHex.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
// 十六进制 关键字校验
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
if(!bl) {
errInfo.append(
prop.getProperty("domain_name") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
}
}
}
isHex = baseStringCfg.getIsHex();
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.equals("1") && isHex.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
}
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
+ ";");
}
// 十六进制 关键字校验
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
if(!bl) {
errInfo.append(
prop.getProperty("domain_name") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
}
}
if (isHex != null && isCaseInsenstive != null) {
if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) {
baseStringCfg.setIsHexbin(0);