diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-10-25 11:27:39 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-10-25 11:27:39 +1100 |
commit | e176aebf6513d8a4b033e1efb593f5700568ae38 (patch) | |
tree | 95a4bfa24407c2f689f1bd4bb445c6ecef69a697 | |
parent | Remove whitespace characters in banned words detection (diff) | |
download | server-e176aebf6513d8a4b033e1efb593f5700568ae38.tar.xz |
handle a specific case with rtl character
-rw-r--r-- | src/util/util/BannedWords.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/util/util/BannedWords.ts b/src/util/util/BannedWords.ts index 04c504f5..28b03546 100644 --- a/src/util/util/BannedWords.ts +++ b/src/util/util/BannedWords.ts @@ -22,6 +22,9 @@ export const BannedWords = { find: (val: string) => { InvisibleCharacters.forEach(x => val = val.replaceAll(x, "")); - return words.some((x) => val.indexOf(x) != -1); + var normal = words.some((x) => val.indexOf(x) != -1); + val = val.split("").reverse().join(""); + var rtlOverride = words.some((x) => val.indexOf(x) != -1); + return normal || rtlOverride; }, }; |