From fdbd150ce317177bcc35c238a014dcfe9a5825a1 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Tue, 25 Oct 2022 11:27:39 +1100 Subject: [PATCH] handle a specific case with rtl character --- src/util/util/BannedWords.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }, };