summary refs log tree commit diff
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
commit252bc880e8d7735674b657511500f167a1f2d5b6 (patch)
treee582a4848d6236ca997db1227fe2dbb16878fd2d
parentFix BannedWords breaking because windows line endings (diff)
downloadserver-252bc880e8d7735674b657511500f167a1f2d5b6.tar.xz
Remove whitespace characters in banned words detection
-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);
 	},
 };