mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Fixed incorrect validation when member's name is too long
no issue - the email length validation was conditional on `member.name` rather than `member.email` so if the name was too long both name and email were marked as invalid
This commit is contained in:
parent
07f24e69f6
commit
59a15a0895
@ -16,13 +16,13 @@ export default BaseValidator.create({
|
||||
let email = model.get('email');
|
||||
|
||||
if (isBlank(email)) {
|
||||
model.get('errors').add('email', 'Please enter an email.');
|
||||
model.errors.add('email', 'Please enter an email.');
|
||||
this.invalidate();
|
||||
} else if (!validator.isEmail(email)) {
|
||||
model.get('errors').add('email', 'Invalid Email.');
|
||||
model.errors.add('email', 'Invalid Email.');
|
||||
this.invalidate();
|
||||
}
|
||||
if (!validator.isLength(model.name || '', 0, 191)) {
|
||||
if (!validator.isLength(model.email || '', 0, 191)) {
|
||||
model.errors.add('email', 'Email cannot be longer than 191 characters.');
|
||||
this.invalidate();
|
||||
}
|
||||
@ -34,7 +34,7 @@ export default BaseValidator.create({
|
||||
let note = model.get('note');
|
||||
|
||||
if (!validator.isLength(note || '', 0, 500)) {
|
||||
model.get('errors').add('note', 'Note is too long.');
|
||||
model.errors.add('note', 'Note is too long.');
|
||||
this.invalidate();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user