Skip to content

Commit f15bd86

Browse files
Update index.js 对违禁词的string格式化 (#794)
1 parent 266d8e1 commit f15bd86

File tree

1 file changed

+1
-1
lines changed
  • src/server/function/twikoo/utils

1 file changed

+1
-1
lines changed

src/server/function/twikoo/utils/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ const fn = {
278278
// 违禁词检测
279279
const commentLowerCase = comment.toLowerCase()
280280
const nickLowerCase = nick.toLowerCase()
281-
for (const forbiddenWord of config.FORBIDDEN_WORDS.split(',')) {
281+
for (const forbiddenWord of config.FORBIDDEN_WORDS.replace(/,+$/, '').split(',')) {
282282
const forbiddenWordLowerCase = forbiddenWord.trim().toLowerCase()
283283
if (commentLowerCase.indexOf(forbiddenWordLowerCase) !== -1 || nickLowerCase.indexOf(forbiddenWordLowerCase) !== -1) {
284284
logger.warn('包含违禁词,直接标记为垃圾评论~')

0 commit comments

Comments
 (0)