From 26166deb0c3a9938eeb94725705d49d259aa6e70 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 11 Sep 2012 13:52:10 +0200 Subject: Fix integer validation when boundary value is empty string There was an error in number validation check. If boundary value was an empty string, validation of a number always failed. This patch fixes the problem by not performing the check in these cases. https://fedorahosted.org/freeipa/ticket/3066 --- install/ui/ipa.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'install/ui/ipa.js') diff --git a/install/ui/ipa.js b/install/ui/ipa.js index a2c4c08d..bd25aeae 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -2021,6 +2021,11 @@ IPA.is_empty = function(value) { return empty; }; +IPA.defined = function(value, check_empty_str) { + return value !== null && value !== undefined && + ((check_empty_str && value !== '') || !check_empty_str); +}; + IPA.array_diff = function(a, b) { if (a === b || (!a && !b)) return false; -- cgit