[jira] [Updated] (SOLR-2520) JSONResponseWriter w/json.wrf can produce invalid javascript depending on unicode chars in response data

2011-05-16 Thread Hoss Man (JIRA)

 [ 
https://issues.apache.org/jira/browse/SOLR-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-2520:
---

Summary: JSONResponseWriter w/json.wrf can produce invalid javascript 
depending on unicode chars in response data  (was: Solr creates invalid jsonp 
strings)

Benson: thanks for the clarification, i've updated the summary to attempt to 
clarify the root of the issue.

Would make more sense to have a JavascriptResponseWriter or to have the 
JSONResponseWriter do unicode escaping/stripping if/when json.wrf is specified?

 JSONResponseWriter w/json.wrf can produce invalid javascript depending on 
 unicode chars in response data
 

 Key: SOLR-2520
 URL: https://issues.apache.org/jira/browse/SOLR-2520
 Project: Solr
  Issue Type: Bug
Affects Versions: 4.0
Reporter: Benson Margulies

 Please see http://timelessrepo.com/json-isnt-a-javascript-subset.
 If a stored field contains invalid Javascript characters, and you use the 
 query option to ask for jsonp, solr does *not* escape some invalid Unicode 
 characters, resulting in strings that explode on contact with browsers.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-2520) JSONResponseWriter w/json.wrf can produce invalid javascript depending on unicode chars in response data

2011-05-16 Thread Yonik Seeley (JIRA)

 [ 
https://issues.apache.org/jira/browse/SOLR-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yonik Seeley updated SOLR-2520:
---

Attachment: SOLR-2520.patch

Here's a patch w/ simple test.

 JSONResponseWriter w/json.wrf can produce invalid javascript depending on 
 unicode chars in response data
 

 Key: SOLR-2520
 URL: https://issues.apache.org/jira/browse/SOLR-2520
 Project: Solr
  Issue Type: Bug
Affects Versions: 4.0
Reporter: Benson Margulies
 Attachments: SOLR-2520.patch


 Please see http://timelessrepo.com/json-isnt-a-javascript-subset.
 If a stored field contains invalid Javascript characters, and you use the 
 query option to ask for jsonp, solr does *not* escape some invalid Unicode 
 characters, resulting in strings that explode on contact with browsers.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-2520) JSONResponseWriter w/json.wrf can produce invalid javascript depending on unicode chars in response data

2011-05-16 Thread Benson Margulies (JIRA)

 [ 
https://issues.apache.org/jira/browse/SOLR-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benson Margulies updated SOLR-2520:
---

Description: 
Please see http://timelessrepo.com/json-isnt-a-javascript-subset.

If a stored field contains Unicode characters that are valid in Json but not 
valid in Javascript, and you use the query option to ask for jsonp (json.wrt), 
solr does *not* escape them characters, resulting in content that explodes on 
contact with browsers. That is, there are certain Unicode characters that are 
valid JSON but invalid in Javascript source, and a JSONP response is javascript 
source, to be incorporated in an HTML script tag. 


  was:
Please see http://timelessrepo.com/json-isnt-a-javascript-subset.

If a stored field contains invalid Javascript characters, and you use the query 
option to ask for jsonp, solr does *not* escape some invalid Unicode 
characters, resulting in strings that explode on contact with browsers.



 JSONResponseWriter w/json.wrf can produce invalid javascript depending on 
 unicode chars in response data
 

 Key: SOLR-2520
 URL: https://issues.apache.org/jira/browse/SOLR-2520
 Project: Solr
  Issue Type: Bug
Affects Versions: 4.0
Reporter: Benson Margulies
 Attachments: SOLR-2520.patch


 Please see http://timelessrepo.com/json-isnt-a-javascript-subset.
 If a stored field contains Unicode characters that are valid in Json but not 
 valid in Javascript, and you use the query option to ask for jsonp 
 (json.wrt), solr does *not* escape them characters, resulting in content that 
 explodes on contact with browsers. That is, there are certain Unicode 
 characters that are valid JSON but invalid in Javascript source, and a JSONP 
 response is javascript source, to be incorporated in an HTML script tag. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-2520) JSONResponseWriter w/json.wrf can produce invalid javascript depending on unicode chars in response data

2011-05-16 Thread Benson Margulies (JIRA)

 [ 
https://issues.apache.org/jira/browse/SOLR-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benson Margulies updated SOLR-2520:
---

Description: 
Please see http://timelessrepo.com/json-isnt-a-javascript-subset.

If a stored field contains Unicode characters that are valid in Json but not 
valid in Javascript, and you use the query option to ask for JSONP (json.wrf), 
solr does *not* escape them, resulting in content that explodes on contact with 
browsers. That is, there are certain Unicode characters that are valid JSON but 
invalid in Javascript source, and a JSONP response is javascript source, to be 
incorporated in an HTML script tag. Further investigation suggests that only 
one character is a problem here:  U+2029 must be represented as \u2029 instead 
of left 'as-is'.


  was:
Please see http://timelessrepo.com/json-isnt-a-javascript-subset.

If a stored field contains Unicode characters that are valid in Json but not 
valid in Javascript, and you use the query option to ask for jsonp (json.wrt), 
solr does *not* escape them characters, resulting in content that explodes on 
contact with browsers. That is, there are certain Unicode characters that are 
valid JSON but invalid in Javascript source, and a JSONP response is javascript 
source, to be incorporated in an HTML script tag. 



 JSONResponseWriter w/json.wrf can produce invalid javascript depending on 
 unicode chars in response data
 

 Key: SOLR-2520
 URL: https://issues.apache.org/jira/browse/SOLR-2520
 Project: Solr
  Issue Type: Bug
Affects Versions: 4.0
Reporter: Benson Margulies
 Attachments: SOLR-2520.patch


 Please see http://timelessrepo.com/json-isnt-a-javascript-subset.
 If a stored field contains Unicode characters that are valid in Json but not 
 valid in Javascript, and you use the query option to ask for JSONP 
 (json.wrf), solr does *not* escape them, resulting in content that explodes 
 on contact with browsers. That is, there are certain Unicode characters that 
 are valid JSON but invalid in Javascript source, and a JSONP response is 
 javascript source, to be incorporated in an HTML script tag. Further 
 investigation suggests that only one character is a problem here:  U+2029 
 must be represented as \u2029 instead of left 'as-is'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org