From bbb3722a9bc7fd1fac2b0a1285c4e27b14b461b0 Mon Sep 17 00:00:00 2001 From: Damian Zajkowski Date: Tue, 2 Sep 2014 11:12:31 +0200 Subject: [PATCH] [fix] secure fix, to prevent access to undefined array index Signed-off-by:Damian Zajkowski --- select2_locale_sk.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/select2_locale_sk.js b/select2_locale_sk.js index 0b49850d..027530c9 100644 --- a/select2_locale_sk.js +++ b/select2_locale_sk.js @@ -27,7 +27,7 @@ var n = input.length - max; if (n == 1) { return "Prosím, zadajte o jeden znak menej"; - } else if (n <= 4) { + } else if (n >= 2 && n <= 4) { return "Prosím, zadajte o "+smallNumbers[n](true)+" znaky menej"; } else { return "Prosím, zadajte o "+n+" znakov menej"; @@ -36,7 +36,7 @@ formatSelectionTooBig: function (limit) { if (limit == 1) { return "Môžete zvoliť len jednu položku"; - } else if (limit <= 4) { + } else if (limit >= 2 && limit <= 4) { return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky"; } else { return "Môžete zvoliť najviac "+limit+" položiek";