fix for escaping json control characters in graphql
double escape, once for java and once for json fixes https://github.com/hapifhir/hapi-fhir/issues/3069
This commit is contained in:
parent
19087d2cb5
commit
185c8b99f7
|
@ -102,8 +102,8 @@ public class Argument {
|
|||
public void write(StringBuilder b, int indent) throws EGraphQLException, EGraphEngine {
|
||||
b.append("\"");
|
||||
for (char ch : name.toCharArray()) {
|
||||
if (ch == '"') b.append("\"");
|
||||
else if (ch == '\\') b.append("\\");
|
||||
if (ch == '"') b.append("\\\"");
|
||||
else if (ch == '\\') b.append("\\\\");
|
||||
else if (ch == '\r') b.append("\\r");
|
||||
else if (ch == '\n') b.append("\\n");
|
||||
else if (ch == '\t') b.append("\\t");
|
||||
|
|
|
@ -56,8 +56,8 @@ public class StringValue extends Value {
|
|||
public void write(StringBuilder b, int indent) {
|
||||
b.append("\"");
|
||||
for (char ch : value.toCharArray()) {
|
||||
if (ch == '"') b.append("\"");
|
||||
else if (ch == '\\') b.append("\\");
|
||||
if (ch == '"') b.append("\\\"");
|
||||
else if (ch == '\\') b.append("\\\\");
|
||||
else if (ch == '\r') b.append("\\r");
|
||||
else if (ch == '\n') b.append("\\n");
|
||||
else if (ch == '\t') b.append("\\t");
|
||||
|
|
Loading…
Reference in New Issue