0
Fork 0
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:
Hannah Wolfe 2013-09-19 07:55:37 +01:00
parent 477c4c59fa
commit 5528423636
2 changed files with 4 additions and 3 deletions

View file

@ -171,8 +171,8 @@
.check(email, {message: "Please supply a valid email address", el: $('#email-address')}) .check(email, {message: "Please supply a valid email address", el: $('#email-address')})
.isEmail().len(0, 254); .isEmail().len(0, 254);
Ghost.Validate Ghost.Validate
.check(postsPerPage, {message: "Please use a number", el: $('postsPerPage')}) .check(postsPerPage, {message: "Please use a number less than 1000", el: $('postsPerPage')})
.isInt(); .isInt().max(1000);
if (Ghost.Validate._errors.length > 0) { if (Ghost.Validate._errors.length > 0) {
Ghost.Validate.handleErrors(); Ghost.Validate.handleErrors();

View file

@ -34,7 +34,8 @@
"defaultValue": "6", "defaultValue": "6",
"validations": { "validations": {
"notNull": true, "notNull": true,
"isNumeric": true "isInt": true,
"max": 1000
} }
}, },
"forceI18n": { "forceI18n": {