0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Validate negative numbers in the posts per page setting

issue #1236
- added validation to not allow number less than 0
This commit is contained in:
Enrique Chavez 2013-10-22 13:25:44 -05:00 committed by Hannah Wolfe
parent a7a4420128
commit 3edd0e118d

View file

@ -174,6 +174,10 @@
Ghost.Validate
.check(postsPerPage, {message: "Please use a number less than 1000", el: $('postsPerPage')})
.isInt().max(1000);
Ghost.Validate
.check(postsPerPage, {message: "Please use a number greater than 0", el: $('postsPerPage')})
.isInt().min(0);
if (Ghost.Validate._errors.length > 0) {
Ghost.Validate.handleErrors();