From 6879f2bcd6026d279826d3672e58ffca2b2e947e Mon Sep 17 00:00:00 2001 From: memesaregood Date: Thu, 16 May 2024 18:40:23 +0300 Subject: Allow Date class in a JEXL whitelist --- src/main/java/org/traccar/handler/ComputedAttributesHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar') diff --git a/src/main/java/org/traccar/handler/ComputedAttributesHandler.java b/src/main/java/org/traccar/handler/ComputedAttributesHandler.java index 4293bd1fc..7c2fd70a5 100644 --- a/src/main/java/org/traccar/handler/ComputedAttributesHandler.java +++ b/src/main/java/org/traccar/handler/ComputedAttributesHandler.java @@ -41,6 +41,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.Date; public class ComputedAttributesHandler extends BasePositionHandler { @@ -63,7 +64,7 @@ public class ComputedAttributesHandler extends BasePositionHandler { sandbox.allow(Math.class.getName()); List.of( Double.class, Float.class, Integer.class, Long.class, Short.class, - Character.class, Boolean.class, String.class, Byte.class) + Character.class, Boolean.class, String.class, Byte.class, Date.class) .forEach((type) -> sandbox.allow(type.getName())); features = new JexlFeatures() .localVar(config.getBoolean(Keys.PROCESSING_COMPUTED_ATTRIBUTES_LOCAL_VARIABLES)) -- cgit v1.2.3