mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 12:42:44 +01:00
Remove whitespace characters in banned words detection
This commit is contained in:
parent
c1b955aaae
commit
aba1d02941
@ -1,5 +1,6 @@
|
||||
import fs from "fs/promises";
|
||||
import path from "path";
|
||||
import { InvisibleCharacters } from "./InvisibleCharacters";
|
||||
|
||||
var words: string[];
|
||||
|
||||
@ -20,6 +21,7 @@ export const BannedWords = {
|
||||
get: () => words,
|
||||
|
||||
find: (val: string) => {
|
||||
InvisibleCharacters.forEach(x => val = val.replaceAll(x, ""));
|
||||
return words.some((x) => val.indexOf(x) != -1);
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user