WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16669 closed enhancement (fixed)

JSON2 update

Reported by: niallkennedy Owned by:
Milestone: 3.2 Priority: normal
Severity: minor Version:
Component: External Libraries Keywords: has-patch
Focuses: Cc:

Description

Douglas Crockford moved JSON2 to GitHub. The latest file is dated 2011-02-23 vs. the WP Core file dated 2009-08-17.

Attachments (1)

json2.diff (7.6 KB) - added by niallkennedy 3 years ago.
latest JSON2

Download all attachments as: .zip

Change History (8)

niallkennedy3 years ago

latest JSON2

comment:1 sivel3 years ago

  • Keywords 2nd-opinion added

I'm not so sure we need this. WordPress 3.2 will require PHP 5.2, which includes JSON. The 3.1 point releases wouldn't include this so, perhaps we should focus on removing the JSON lib from the WP code base.

comment:2 sivel3 years ago

Oops, I think I commented without understanding what this was for...

comment:3 niallkennedy3 years ago

The JSON2 library is a JavaScript library to match the ECMAScript 5 compliant native JSON object included in most modern browsers.

If a piece of JavaScript code would like to interpret a string as a JavaScript object it can pass the string to JSON.parse. A JavaScript object may be converted into a string through the JSON.stringify function.

See also:

JavaScript executes on the client-side; it is separate from PHP functions json_decode and json_encode.

Language string to object object to string
JavaScript JSON.parse() JSON.stringify()
PHP json_decode() json_encode()
Version 0, edited 3 years ago by niallkennedy (next)

comment:4 nacin3 years ago

  • Keywords 2nd-opinion removed

Yep, this is good.

On the other hand, Services_JSON will be dying a slow and painful death.

comment:5 sivel3 years ago

Yeah, that is what I get for not paying attention and commenting without looking at the patch. </embarrassment>

comment:6 azaozz3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17679]) Update json2.js, props niallkennedy, fixes #16669

comment:7 ocean903 years ago

  • Milestone changed from Awaiting Review to 3.2
Note: See TracTickets for help on using tickets.