summaryrefslogtreecommitdiffstats
path: root/install/ui/ipa.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-09-11 13:52:10 +0200
committerPetr Vobornik <pvoborni@redhat.com>2012-09-19 11:09:09 +0200
commit26166deb0c3a9938eeb94725705d49d259aa6e70 (patch)
treed4bf0e63a61224de35b6e74b67f471bfb4ea4901 /install/ui/ipa.js
parente39a109060ce8b92919c00aebd83a682a039d9b5 (diff)
downloadfreeipa.git-26166deb0c3a9938eeb94725705d49d259aa6e70.tar.gz
freeipa.git-26166deb0c3a9938eeb94725705d49d259aa6e70.tar.xz
freeipa.git-26166deb0c3a9938eeb94725705d49d259aa6e70.zip
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
Diffstat (limited to 'install/ui/ipa.js')
-rw-r--r--install/ui/ipa.js5
1 files changed, 5 insertions, 0 deletions
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;