Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add non-word character check
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 963eee0 commit 4575843
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/api/reports/submit.ts
Expand Up @@ -78,7 +78,8 @@ export async function onRequestPost(context: RequestContext) {
if (
username.length < 3 ||
username.length > 20 ||
username.match(/_/g)?.length > 1
username.match(/_/g)?.length > 1 ||
username.match(/\W/)
)
return jsonError(`Username "${username}" is invalid`, 400);
}
Expand Down

0 comments on commit 4575843

Please sign in to comment.