代码优化

This commit is contained in:
稚屿
2022-02-09 09:10:50 +08:00
parent a29201a248
commit c99eb98001
16 changed files with 37 additions and 57 deletions

View File

@ -50,10 +50,8 @@ public class SqlUtil
return;
}
String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|");
for (int i = 0; i < sqlKeywords.length; i++)
{
if (StringUtils.indexOfIgnoreCase(value, sqlKeywords[i]) > -1)
{
for (String sqlKeyword : sqlKeywords) {
if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) {
throw new UtilException("参数存在SQL注入风险");
}
}