From b516f6fce170ef7a563003f77f1cacc14780b663 Mon Sep 17 00:00:00 2001 From: Kevin Kelly Date: Wed, 8 Jul 2015 17:18:08 -0700 Subject: [PATCH] Update location.dev.js longlat check is passing invalid co-ordinates, updated regex to only pass valid co-ordinates --- form-validator/location.dev.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/form-validator/location.dev.js b/form-validator/location.dev.js index 80e7060..065b75c 100644 --- a/form-validator/location.dev.js +++ b/form-validator/location.dev.js @@ -44,7 +44,7 @@ $.formUtils.addValidator({ name : 'longlat', validatorFunction : function(str) { - var regexp = /^[+-]?\d+\.\d+, ?[+-]?\d+\.\d+$/; + var regexp = /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/; return regexp.test(str); }, errorMessage:'', @@ -75,4 +75,4 @@ return $.formUtils.suggest(this, states, settings); }; -})(jQuery); \ No newline at end of file +})(jQuery);