Fixes conditions with floating point numbers

Reported in SD-9504

Bug introduced in 423ae8977e
SD-9217

Commit related to 1a4d33879a, which tried to fix the issue
This commit is contained in:
Christian Koop 2023-04-06 09:39:53 +02:00
parent 56e7174e42
commit ec8e0aa975
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3

View File

@ -99,7 +99,7 @@ public class GeneralUtils {
}
public static Object parseJS(String toParse, String type, Object def) {
if (toParse.trim().matches("^\\d+\\s+(<|>)\\s*\\d+$")) { // e.g. "1 < 2"
if (toParse.trim().matches("^\\d+(?>\\.\\d+)?\\s+([<>])\\s*\\d+(?>\\.\\d+)?$")) { // e.g. "1 < 2"
toParse = toParse.trim();
double firstNumber = Double.parseDouble(toParse.substring(0, toParse.indexOf(" ")));