Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-Beta2
-
Fix Version/s: 2.0.0
-
Component/s: ACE-Components
-
Labels:None
-
Environment:ACE
Description
The ACE components use JSON escaping to pass parameters from the server to the client, specifically the JSProps and JSFProps parameters. The string escaping adds quotes, and escapes quotes, but also escapes backslashes and forward slashes. In the browser, the escape sequence for the forward slashes remains, as evidenced by inspecting the thumbUrl property on sliderEntry. We need to do some escaping, so that javascript values can exist within an html tag's attribute value.
The solution need not specifically be JSON. We could do less escaping, that's non-JSON, or we could use YUI code to JSON unescape the values.
The solution need not specifically be JSON. We could do less escaping, that's non-JSON, or we could use YUI code to JSON unescape the values.
This is the code in JSONBuilder that causes the issue. This illustrates the need for JSON unescaping in the browser.
public JSONBuilder entry(String key, String value, boolean isStringLiteral)
{ ... value = value.replace("/", "\\/"); ... }