mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 20:34:02 +03:00
Added missing client validations for blog title and user/subscriber email fields (#909)
refs TryGhost/Ghost#8143 Added more client side validations for input fields: - Blog title in setup flow (150 chars) - User email (191 chars) - Subscribers email (191 chars)
This commit is contained in:
parent
d028b5a5b9
commit
18614c39f6
@ -10,5 +10,10 @@ export default NewUserValidator.create({
|
|||||||
model.get('errors').add('blogTitle', 'Please enter a blog title.');
|
model.get('errors').add('blogTitle', 'Please enter a blog title.');
|
||||||
this.invalidate();
|
this.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!validator.isLength(blogTitle, 0, 150)) {
|
||||||
|
model.get('errors').add('blogTitle', 'Title is too long');
|
||||||
|
this.invalidate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -14,6 +14,10 @@ export default BaseValidator.create({
|
|||||||
model.get('errors').add('email', 'Invalid email.');
|
model.get('errors').add('email', 'Invalid email.');
|
||||||
model.get('hasValidated').pushObject('email');
|
model.get('hasValidated').pushObject('email');
|
||||||
this.invalidate();
|
this.invalidate();
|
||||||
|
} else if (!validator.isLength(email, 0, 191)) {
|
||||||
|
model.get('errors').add('email', 'Email is too long');
|
||||||
|
model.get('hasValidated').pushObject('email');
|
||||||
|
this.invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -40,6 +40,11 @@ export default PasswordValidator.create({
|
|||||||
model.get('errors').add('email', 'Please supply a valid email address');
|
model.get('errors').add('email', 'Please supply a valid email address');
|
||||||
this.invalidate();
|
this.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!validator.isLength(email, 0, 191)) {
|
||||||
|
model.get('errors').add('email', 'Email is too long');
|
||||||
|
this.invalidate();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
location(model) {
|
location(model) {
|
||||||
|
Loading…
Reference in New Issue
Block a user