Skip to content

Commit

Permalink
解决单个敏感词无法过滤的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyrain2012 committed Sep 2, 2021
1 parent 81a2ab8 commit c7e2063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion broker/src/main/java/win/liyufan/im/SensitiveFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public SensitiveFilter(Set<String> sensitiveWords){
Iterator<String> iterator = sensitiveWords.iterator();
while (iterator.hasNext()){
currentWord=iterator.next();
if(currentWord==null||currentWord.trim().length()<2){ //敏感词长度必须大于等于2
if(currentWord==null||currentWord.trim().length()<1){ //敏感词长度必须大于等于1
continue;
}
currentMap=sensitiveWordsMap;
Expand Down

0 comments on commit c7e2063

Please sign in to comment.