[
https://issues.apache.org/jira/browse/THRIFT-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13856977#comment-13856977
]
Hudson commented on THRIFT-2285:
--------------------------------
FAILURE: Integrated in Thrift #958 (See
[https://builds.apache.org/job/Thrift/958/])
THRIFT-2285 TJsonProtocol implementation for Java/JavaMe/PHP doesn't allow a
slash (/) to be escaped (\/) (jensg: rev
797595049274b9085385de5ef402075f6fc3de56)
* lib/javame/src/org/apache/thrift/protocol/TJSONProtocol.java
* lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java
* lib/php/lib/Thrift/Protocol/TJSONProtocol.php
> TJsonProtocol implementation for Java doesn't allow a slash (/) to be escaped
> (\/)
> ----------------------------------------------------------------------------------
>
> Key: THRIFT-2285
> URL: https://issues.apache.org/jira/browse/THRIFT-2285
> Project: Thrift
> Issue Type: Bug
> Components: Java - Library, JavaME - Library, PHP - Library
> Reporter: Alexander Steshenko
> Assignee: Jens Geyer
> Fix For: 0.9.2
>
> Attachments:
> THRIFT-2285_JSON_forward_slash_solidus_decoding_java-javame-php.patch
>
>
> We have PHP frontend and Java backend. Thrift is used for interaction between
> the two, entities are serialized and deserialized using TJsonProtocol.
> Whenever a string in a thrift entity contains a slash "/", PHP's
> implementation, that uses {{json_encode}} under the hood, escapes it:
> "Translation eng/rus" => "Translation eng\/rus". So the payload may look like
> this:
> {noformat}
> {"1":{"str":"Translation rus\/eng"}}
> {noformat}
> (assuming that the entity only has this one string property)
> Java cannot handle this input and fails with:
> org.apache.thrift.protocol.TProtocolException: Expected control char
> Java does not allow a slash to be escaped.
> Thrift version is 0.9.1
> Any advice on what to do for a temporary solution? Should we fix Java side or
> PHP side?
> As per json.org, a slash CAN be escaped. To me it looks more like Java is not
> standard compliant in this case. At the same time, however, I don't like the
> ambiguity of the standard allowing both unescaped and escaped slash.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)