From 3edd0e118dd72c1d7d11d6e00b5e0047ae339fe0 Mon Sep 17 00:00:00 2001 From: Enrique Chavez Date: Tue, 22 Oct 2013 13:25:44 -0500 Subject: [PATCH] Validate negative numbers in the posts per page setting issue #1236 - added validation to not allow number less than 0 --- core/client/views/settings.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/client/views/settings.js b/core/client/views/settings.js index 4bce8f1f33..4739816163 100644 --- a/core/client/views/settings.js +++ b/core/client/views/settings.js @@ -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();