GH-2681 - Sanitize label replacements.

This requires an update of the CypherDSL to use the built-in
function instead of copying code.
This commit is contained in:
Gerrit Meier
2023-02-28 14:17:21 +01:00
parent 5b6cb19c53
commit 957284edb8

View File

@@ -26,6 +26,7 @@ import java.util.stream.Collectors;
import org.apache.commons.logging.LogFactory;
import org.apiguardian.api.API;
import org.neo4j.cypherdsl.core.internal.SchemaNames;
import org.springframework.core.log.LogAccessor;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
@@ -111,7 +112,9 @@ public final class Neo4jSpelSupport {
private static String joinStrings(Object arg, String joinOn) {
if (arg instanceof Collection) {
return ((Collection<?>) arg).stream().map(Object::toString).collect(Collectors.joining(joinOn));
return ((Collection<?>) arg).stream()
.map(o -> SchemaNames.sanitize(o.toString()).get())
.collect(Collectors.joining(joinOn));
}
// we are so kind and also accept plain strings instead of collection<string>