1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-20 01:31:34 +02:00

handle a specific case with rtl character

This commit is contained in:
Madeline 2022-10-25 11:27:39 +11:00
parent 252bc880e8
commit e176aebf65
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -22,6 +22,9 @@ export const BannedWords = {
find: (val: string) => { find: (val: string) => {
InvisibleCharacters.forEach(x => val = val.replaceAll(x, "")); 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;
}, },
}; };