mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Remove unicode control characters from username
This commit is contained in:
parent
dad4fbca75
commit
3a60b6fff7
1 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,10 @@ export async function setUsername(req: Request, res: Response) {
|
|||
res.sendStatus(200);
|
||||
return;
|
||||
}
|
||||
|
||||
// remove unicode control characters from username (example: \n, \r, \t etc.)
|
||||
// source: https://en.wikipedia.org/wiki/Control_character#In_Unicode
|
||||
userName = userName.replace(/[\u0000-\u001F\u007F-\u009F]/g, '');
|
||||
|
||||
if (adminUserIDInput != undefined) {
|
||||
//this is the admin controlling the other users account, don't hash the controling account's ID
|
||||
|
|
Loading…
Reference in a new issue