From 04e8960df6748b58edef05a52e1eeab2a8e34782 Mon Sep 17 00:00:00 2001 From: Geoffrey Wu Date: Thu, 23 May 2024 23:11:31 -0500 Subject: [PATCH] fix `isAppropriateString` implementation bug --- server/moderation/is-appropriate-string.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/moderation/is-appropriate-string.js b/server/moderation/is-appropriate-string.js index 26062664..d335918c 100644 --- a/server/moderation/is-appropriate-string.js +++ b/server/moderation/is-appropriate-string.js @@ -11,8 +11,9 @@ export default function isAppropriateString(string) { } string = string.replace(/(-|_)/g, ' ').toLowerCase(); + const tokens = string.split(' '); - if (inappropriateNames.some(name => string === name)) { + if (inappropriateNames.some(name => tokens.includes(name))) { return false; }