敏感词大小写的问题
This commit is contained in:
@@ -2229,7 +2229,7 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
public boolean addSensitiveWords(List<String> words) {
|
public boolean addSensitiveWords(List<String> words) {
|
||||||
for (String word :
|
for (String word :
|
||||||
words) {
|
words) {
|
||||||
databaseStore.persistSensitiveWord(word);
|
databaseStore.persistSensitiveWord(word.toLowerCase());
|
||||||
}
|
}
|
||||||
lastUpdateSensitiveTime = 0;
|
lastUpdateSensitiveTime = 0;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public class SensitiveFilter {
|
|||||||
return sensitiveWords;
|
return sensitiveWords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
text = text.toLowerCase();
|
||||||
for(int i=0;i<text.length();i++){
|
for(int i=0;i<text.length();i++){
|
||||||
int sensitiveWordLength = getSensitiveWordLength(text, i, matchType);
|
int sensitiveWordLength = getSensitiveWordLength(text, i, matchType);
|
||||||
if(sensitiveWordLength>0){
|
if(sensitiveWordLength>0){
|
||||||
|
|||||||
Reference in New Issue
Block a user