Skip to content

Commit

Permalink
[inner-1787] fix: statement insertion errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LUAgam committed Sep 6, 2023
1 parent 9c1fc29 commit 9285050
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,21 +482,23 @@ public static String getPasswordEncrypt(String instanceName, String name, String
}

private void checkChineseProperty(String val, String name) {
if (StringUtil.isBlank(val)) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal, the value not be null or empty");
}
int length = 11;
if (val.length() > length) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal, the value contains a maximum of " + length + " characters");
}
if (Objects.nonNull(val)) {
if (StringUtil.isBlank(val)) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal, the value not be null or empty");
}
int length = 11;
if (val.length() > length) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal, the value contains a maximum of " + length + " characters");
}

String chinese = val.replaceAll(XMLDbLoader.PATTERN_DB.toString(), "");
if (Strings.isNullOrEmpty(chinese)) {
return;
}
String chinese = val.replaceAll(XMLDbLoader.PATTERN_DB.toString(), "");
if (Strings.isNullOrEmpty(chinese)) {
return;
}

if (!StringUtil.isChinese(chinese)) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal,the " + Charset.defaultCharset().name() + " encoding is recommended, Column [ " + name + " ] show be use u4E00-u9FA5a-zA-Z_0-9\\-\\.");
if (!StringUtil.isChinese(chinese)) {
throw new ConfigException("Column [ " + name + " ] " + val + " is illegal,the " + Charset.defaultCharset().name() + " encoding is recommended, Column [ " + name + " ] show be use u4E00-u9FA5a-zA-Z_0-9\\-\\.");
}
}
}

Expand Down

0 comments on commit 9285050

Please sign in to comment.