mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
Remove unicode control characters from username
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user