mirror of
https://github.com/wassname/talk.git
synced 2026-08-14 12:50:17 +08:00
don't use regex on existing lists
This commit is contained in:
@@ -176,8 +176,8 @@ class Wordlist {
|
||||
displayName = displayName.replace(/_/g, '');
|
||||
|
||||
// test each word, and fail if we find a match
|
||||
const hasBadWords = wl.lists.banned.some(word => {
|
||||
return new RegExp(word, 'ig').test(displayName);
|
||||
const hasBadWords = wl.lists.banned.some(phrase => {
|
||||
return displayName.indexOf(phrase.join('')) !== -1;
|
||||
});
|
||||
|
||||
if (hasBadWords) {
|
||||
|
||||
Reference in New Issue
Block a user