Merge pull request #690 from reasonableJP/fix_escaping_json_control_characters
fix for escaping json control characters in graphql
This commit is contained in:
commit
1a713d9b85
|
@ -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