mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-09 15:43:41 +08:00
fix: fix SensitiveWords error
This commit is contained in:
@@ -40,7 +40,7 @@ func SensitiveWordReplace(text string, returnImmediately bool) (bool, []string,
|
||||
for _, hit := range hits {
|
||||
pos := hit.Pos
|
||||
word := string(hit.Word)
|
||||
text = text[:pos] + "*###*" + text[pos+len(word):]
|
||||
text = text[:pos] + "**###**" + text[pos+len(word):]
|
||||
words = append(words, word)
|
||||
}
|
||||
return true, words, text
|
||||
|
||||
Reference in New Issue
Block a user