mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 00:15:11 +03:00
Validate user URL input to ensure protocol is present
closes #1623 - added protocol validation to isURL on user settings validator. - added placeholder URL to user profile template - ref: https://github.com/sethlilly/Vapor/issues/10 - ref: https://github.com/oswaldoacauan/ghostium/issues/38
This commit is contained in:
parent
ff0dc79546
commit
a79bbd686f
@ -32,7 +32,7 @@ var UserModel = BaseModel.extend({
|
||||
}
|
||||
|
||||
if (this.get('website').length) {
|
||||
if (!validator.isURL(this.get('website')) ||
|
||||
if (!validator.isURL(this.get('website'), { protocols: ['http', 'https'], require_protocol: true }) ||
|
||||
!validator.isLength(this.get('website'), 0, 2000)) {
|
||||
validationErrors.push({message: "Please use a valid url"});
|
||||
}
|
||||
@ -121,4 +121,4 @@ var UserModel = BaseModel.extend({
|
||||
}
|
||||
});
|
||||
|
||||
export default UserModel;
|
||||
export default UserModel;
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user-website">Website</label>
|
||||
{{input type="url" value=user.website id="user-website" autocapitalize="off" autocorrect="off"}}
|
||||
{{input type="url" value=user.website id="user-website" placeholder="http://www.ghost.org/" autocapitalize="off" autocorrect="off"}}
|
||||
<p>Have a website or blog other than this one? Link it!</p>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user