summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-25 11:20:01 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-25 11:20:01 +1100
commitaba1d029413359d41d683d74d7c3c469857b2d3d (patch)
treeab04be6970c14a427bd6c461b1b962f29d4ae028 /src
parentFix BannedWords breaking because windows line endings (diff)
downloadserver-aba1d029413359d41d683d74d7c3c469857b2d3d.tar.xz
Remove whitespace characters in banned words detection
Diffstat (limited to 'src')
-rw-r--r--src/util/util/BannedWords.ts2
1 files changed, 2 insertions, 0 deletions
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); }, };