From aba1d029413359d41d683d74d7c3c469857b2d3d Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Tue, 25 Oct 2022 11:20:01 +1100 Subject: Remove whitespace characters in banned words detection --- src/util/util/BannedWords.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/util/util/BannedWords.ts b/src/util/util/BannedWords.ts index e56635d5..04c504f5 100644 --- a/src/util/util/BannedWords.ts +++ b/src/util/util/BannedWords.ts @@ -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); }, }; -- cgit 1.4.1