Skip to content

Commit

Permalink
fix isAppropriateString implementation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-wu committed May 24, 2024
1 parent 6a1c93e commit 04e8960
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/moderation/is-appropriate-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 04e8960

Please sign in to comment.