From e1c4e18a3fd5448ba5c81ee9c3fba3a3213db30e Mon Sep 17 00:00:00 2001 From: datomo Date: Mon, 8 Apr 2024 13:47:20 +0200 Subject: [PATCH] added missing escape --- .../main/java/org/polypheny/db/type/entity/PolyString.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/polypheny/db/type/entity/PolyString.java b/core/src/main/java/org/polypheny/db/type/entity/PolyString.java index a922bb8ead..4d8326c898 100644 --- a/core/src/main/java/org/polypheny/db/type/entity/PolyString.java +++ b/core/src/main/java/org/polypheny/db/type/entity/PolyString.java @@ -88,12 +88,12 @@ public static PolyString ofNullable( String value ) { @Override public @Nullable String toJson() { - return value == null ? JsonToken.VALUE_NULL.asString() : value.replace( "\"", "\\\"" ); + return value == null ? JsonToken.VALUE_NULL.asString() : value.replace( "\\", "\\\\" ).replace( "\"", "\\\"" ); } public @Nullable String toQuotedJson() { - return value == null ? JsonToken.VALUE_NULL.asString() : "\"" + value.replace( "\"", "\\\"" ) + "\""; + return value == null ? JsonToken.VALUE_NULL.asString() : "\"" + value.replace( "\\", "\\\\" ).replace( "\"", "\\\"" ) + "\""; }