Resolve #365
This commit is contained in:
parent
2bd03ca725
commit
2615368b1e
8 changed files with 23 additions and 36 deletions
|
@ -53,12 +53,14 @@ function validatePerson(x: any, uri: string) {
|
|||
return new Error('invalid person: inbox is not a string');
|
||||
}
|
||||
|
||||
if (!Users.validateUsername(x.preferredUsername, true)) {
|
||||
if (!Users.validateRemoteUsername.ok(x.preferredUsername)) {
|
||||
return new Error('invalid person: invalid username');
|
||||
}
|
||||
|
||||
if (!Users.isValidName(x.name == '' ? null : x.name)) {
|
||||
return new Error('invalid person: invalid name');
|
||||
if (x.name != null && x.name != '') {
|
||||
if (!Users.validateName.ok(x.name)) {
|
||||
return new Error('invalid person: invalid name');
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof x.id !== 'string') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue