mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
parent
4406d350c4
commit
b90f3221aa
1 changed files with 3 additions and 5 deletions
|
@ -41,11 +41,9 @@ var User = DS.Model.extend({
|
||||||
validationErrors.push({message: 'Location is too long'});
|
validationErrors.push({message: 'Location is too long'});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.get('website').length) {
|
if (!validator.isURL(this.get('website'), { protocols: ['http', 'https'], require_protocol: true }) ||
|
||||||
if (!validator.isURL(this.get('website'), { protocols: ['http', 'https'], require_protocol: true }) ||
|
!validator.isLength(this.get('website'), 0, 2000)) {
|
||||||
!validator.isLength(this.get('website'), 0, 2000)) {
|
validationErrors.push({message: 'Please use a valid url'});
|
||||||
validationErrors.push({message: 'Please use a valid url'});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return validationErrors;
|
return validationErrors;
|
||||||
|
|
Loading…
Add table
Reference in a new issue