mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Client & Server side validation for posts per page
closes #839 - caused a 500 error
This commit is contained in:
parent
477c4c59fa
commit
5528423636
2 changed files with 4 additions and 3 deletions
|
@ -171,8 +171,8 @@
|
|||
.check(email, {message: "Please supply a valid email address", el: $('#email-address')})
|
||||
.isEmail().len(0, 254);
|
||||
Ghost.Validate
|
||||
.check(postsPerPage, {message: "Please use a number", el: $('postsPerPage')})
|
||||
.isInt();
|
||||
.check(postsPerPage, {message: "Please use a number less than 1000", el: $('postsPerPage')})
|
||||
.isInt().max(1000);
|
||||
|
||||
if (Ghost.Validate._errors.length > 0) {
|
||||
Ghost.Validate.handleErrors();
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
"defaultValue": "6",
|
||||
"validations": {
|
||||
"notNull": true,
|
||||
"isNumeric": true
|
||||
"isInt": true,
|
||||
"max": 1000
|
||||
}
|
||||
},
|
||||
"forceI18n": {
|
||||
|
|
Loading…
Reference in a new issue