diff --git a/elide-datastore/elide-datastore-aggregation/src/main/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueType.java b/elide-datastore/elide-datastore-aggregation/src/main/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueType.java index f952c4d00b..b36ab92159 100644 --- a/elide-datastore/elide-datastore-aggregation/src/main/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueType.java +++ b/elide-datastore/elide-datastore-aggregation/src/main/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueType.java @@ -29,7 +29,7 @@ public enum ValueType { INTEGER("^[+-]?\\d+$"), DECIMAL("^[+-]?((\\d+(\\.\\d+)?)|(\\.\\d+))$"), MONEY("^[+-]?((\\d+(\\.\\d+)?)|(\\.\\d+))$"), - TEXT("^[a-zA-Z0-9_]+$"), //Very restricted to prevent SQL Injection + TEXT("^[a-zA-Z0-9_-]+$"), //Very restricted to prevent SQL Injection COORDINATE("^(-?\\d+(\\.\\d+)?)|(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$"), BOOLEAN("^(?i)true|false(?-i)|0|1$"), ID("^[a-zA-Z0-9_]+$"), diff --git a/elide-datastore/elide-datastore-aggregation/src/test/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueTypeTest.java b/elide-datastore/elide-datastore-aggregation/src/test/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueTypeTest.java index d5900888db..90d8a4df05 100644 --- a/elide-datastore/elide-datastore-aggregation/src/test/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueTypeTest.java +++ b/elide-datastore/elide-datastore-aggregation/src/test/java/com/yahoo/elide/datastores/aggregation/metadata/enums/ValueTypeTest.java @@ -168,6 +168,7 @@ public void testValidTextValues() { assertTrue(ValueType.TEXT.matches("XYZ")); assertTrue(ValueType.TEXT.matches("123abc")); assertTrue(ValueType.TEXT.matches("___XYZ123abcABC")); + assertTrue(ValueType.TEXT.matches("r2-d2")); } @Test