diff options
-rw-r--r-- | server.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -28,6 +28,8 @@ const LIMIT_ACTIVE_GAMES = (process.env.LIMIT_ACTIVE_GAMES | 0) || 29 const REGEX_MAIL = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/ const REGEX_NAME = /^[\p{Alpha}\p{Number}'_-]+( [\p{Alpha}\p{Number}'_-]+)*$/u +const FORBIDDEN_NAME = /^(Deleted|None|Draw|Both|All|null|admin)/i + const WEBHOOKS = process.env.WEBHOOKS | 0 if (WEBHOOKS) console.log("Webhook notifications enabled.") @@ -281,6 +283,8 @@ function is_valid_user_name(name) { return false if (name.length > 50) return false + if (FORBIDDEN_NAME.test(name)) + return false return REGEX_NAME.test(name) } |