mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 08:26:19 +02:00
Fix username/mention regexes
* Allow underscore instead of hypen * Fix domain part handling * Add tests for remote mention
This commit is contained in:
@@ -89,7 +89,7 @@ export const isRemoteUser = (user: any): user is IRemoteUser =>
|
||||
|
||||
//#region Validators
|
||||
export function validateUsername(username: string): boolean {
|
||||
return typeof username == 'string' && /^[a-zA-Z0-9\-]{3,20}$/.test(username);
|
||||
return typeof username == 'string' && /^[a-zA-Z0-9_]{3,20}$/.test(username);
|
||||
}
|
||||
|
||||
export function validatePassword(password: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user