1
0
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:
Madeline 2022-10-25 11:20:01 +11:00
parent c1b955aaae
commit aba1d02941

View File

@ -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);
},
};