Fix BETWEEN search does not validate input since there is a space "1, 2" instead of "1,2"

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2023-11-12 18:09:19 +01:00
parent f3e714910e
commit 119208b39c
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -178,7 +178,7 @@ function verifyAfterSearchFieldChange (index, searchFormId) {
// BETWEEN and NOT BETWEEN
// See all possible syntaxes in tests of https://regexr.com/7h1eq
jQuery.validator.addMethod('validationFunctionForMultipleInt', function (value) {
return value.match(/^(((0x[0-9a-f]+)|([+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)(e[+-]?[0-9]+)?))(,|$))+$/i) !== null;
return value.replace(/ /g,'').match(/^(((0x[0-9a-f]+)|([+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)(e[+-]?[0-9]+)?))(,|$))+$/i) !== null;
},
Messages.strEnterValidNumber
);