Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Jul 2009 at 02:40 UTC
Updated:
5 Feb 2010 at 12:56 UTC
Jump to comment: Most recent file
Comments
Comment #1
burningdog commentedPatch attached, same as the D6 patch (waiting to be tested) here: http://drupal.org/node/479368#comment-2562104
Comment #2
heine commentedIndeed, RFC 4627 is quite clear on the characters that may be escaped by the reverse solidus and a single quote is not among them:
Comment #3
heine commentedBumping to D6.
Comment #4
burningdog commentedSorry, I didn't make that clear: it's not the apostrophe that's the problem, it's the backslash escaping the apostrophe.
Take this JSON:
{ "value": "Shouldn\'t this work?" }It doesn't validate at http://www.jsonlint.com/ To get it to validate, take out the backslash:
{ "value": "Shouldn't this work?" }My patch at http://drupal.org/node/479368#comment-2562192 fixes this for D6.
Comment #5
heine commentedI'm not arguing against the backslash escape being a problem ("Indeed, RFC 4627 is quite clear on the characters that may be escaped by the reverse solidus and a single quote is not among them"), I just don't see how your patch can work as per my comment on the other issue.
Comment #6
heine commentedLet's mark this a 'duplicate' of #479368: D7: Create RFC compliant HTML safe JSON for Drupal 5 and 6.
Comment #7
burningdog commented@Heine, I re-rolled the patch as per your comments on the duplicate - it should work now :)