Updated Branches:
  refs/heads/master 53db7cc48 -> 797595049

THRIFT-2285 TJsonProtocol implementation for Java/JavaMe/PHP doesn't allow a 
slash (/) to be escaped (\/)

Patch: Jens Geyer


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/79759504
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/79759504
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/79759504

Branch: refs/heads/master
Commit: 797595049274b9085385de5ef402075f6fc3de56
Parents: 53db7cc
Author: Jens Geyer <[email protected]>
Authored: Thu Dec 26 18:56:54 2013 +0100
Committer: Jens Geyer <[email protected]>
Committed: Thu Dec 26 18:59:15 2013 +0100

----------------------------------------------------------------------
 lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java   | 4 ++--
 lib/javame/src/org/apache/thrift/protocol/TJSONProtocol.java | 4 ++--
 lib/php/lib/Thrift/Protocol/TJSONProtocol.php                | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/79759504/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java
----------------------------------------------------------------------
diff --git a/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java 
b/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java
index f07a4a7..02f36e3 100644
--- a/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java
+++ b/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java
@@ -70,10 +70,10 @@ public class TJSONProtocol extends TProtocol {
     1,  1,'"',  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, // 2
   };
 
-  private static final String ESCAPE_CHARS = "\"\\bfnrt";
+  private static final String ESCAPE_CHARS = "\"\\/bfnrt";
 
   private static final byte[] ESCAPE_CHAR_VALS = {
-    '"', '\\', '\b', '\f', '\n', '\r', '\t',
+    '"', '\\', '/', '\b', '\f', '\n', '\r', '\t',
   };
 
   private static final int  DEF_STRING_SIZE = 16;

http://git-wip-us.apache.org/repos/asf/thrift/blob/79759504/lib/javame/src/org/apache/thrift/protocol/TJSONProtocol.java
----------------------------------------------------------------------
diff --git a/lib/javame/src/org/apache/thrift/protocol/TJSONProtocol.java 
b/lib/javame/src/org/apache/thrift/protocol/TJSONProtocol.java
index fd92d45..de7086f 100644
--- a/lib/javame/src/org/apache/thrift/protocol/TJSONProtocol.java
+++ b/lib/javame/src/org/apache/thrift/protocol/TJSONProtocol.java
@@ -66,10 +66,10 @@ public class TJSONProtocol extends TProtocol {
       1, 1, '"', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2
                                                 };
 
-  private static final String  ESCAPE_CHARS     = "\"\\bfnrt";
+  private static final String  ESCAPE_CHARS     = "\"\\/bfnrt";
 
   private static final byte[]  ESCAPE_CHAR_VALS = {
-                                                '"', '\\', '\b', '\f', '\n', 
'\r', '\t',
+                                                '"', '\\', '/', '\b', '\f', 
'\n', '\r', '\t',
                                                 };
 
   private static final int     DEF_STRING_SIZE  = 16;

http://git-wip-us.apache.org/repos/asf/thrift/blob/79759504/lib/php/lib/Thrift/Protocol/TJSONProtocol.php
----------------------------------------------------------------------
diff --git a/lib/php/lib/Thrift/Protocol/TJSONProtocol.php 
b/lib/php/lib/Thrift/Protocol/TJSONProtocol.php
index 3d39583..402401a 100644
--- a/lib/php/lib/Thrift/Protocol/TJSONProtocol.php
+++ b/lib/php/lib/Thrift/Protocol/TJSONProtocol.php
@@ -57,10 +57,10 @@ class TJSONProtocol extends TProtocol
         1, 1, '"', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2
     );
 
-    public static $ESCAPE_CHARS = array('"', '\\', "b", "f", "n", "r", "t");
+    public static $ESCAPE_CHARS = array('"', '\\', '/', "b", "f", "n", "r", 
"t");
 
     public static $ESCAPE_CHAR_VALS = array(
-        '"', '\\', "\x08", "\f", "\n", "\r", "\t",
+        '"', '\\', '/', "\x08", "\f", "\n", "\r", "\t",
     );
 
     const NAME_BOOL = "tf";

Reply via email to