Skip to content

Commit

Permalink
Fix json serialization on REST protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
luigidellaquila committed May 23, 2018
1 parent 9c3b9ae commit 4a55ac6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.orientechnologies.orient.core.record.OVertex;
import com.orientechnologies.orient.core.record.impl.OBlob;
import com.orientechnologies.orient.core.util.ODateHelper;
import jdk.nashorn.internal.ir.debug.JSONWriter;

import java.util.*;

Expand Down Expand Up @@ -214,7 +215,9 @@ default String toJson(Object val) {
}

default String encode(String s) {
String result = s.replaceAll("\"", "\\\\\"");
JSONWriter writer;
String result = s.replaceAll("\\\\", "\\\\\\\\");
result = result.replaceAll("\"", "\\\\\"");
result = result.replaceAll("\n", "\\\\n");
result = result.replaceAll("\t", "\\\\t");
return result;
Expand Down

0 comments on commit 4a55ac6

Please sign in to comment.