[wp-trac] [WordPress Trac] #40718: MCE editor_settings first_init 'format' JSON names should be quoted
WordPress Trac
noreply at wordpress.org
Wed May 10 18:27:49 UTC 2017
#40718: MCE editor_settings first_init 'format' JSON names should be quoted
--------------------------+-----------------------------
Reporter: MrGregWaugh | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: TinyMCE | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
The default 'format' JSON value does not quote the key names in objects.
This is required by JSON spec RFC 7159
(https://tools.ietf.org/html/rfc7159#page-6) and also required by PHP's
json_decode (Example 3: http://php.net/manual/en/function.json-
decode.php). This makes it difficult to parse and modify using built-in
libraries.
Example:
{{{
{alignleft: [{selector: "p,h1,etc", styles: {textAlign:"left"}}]}
}}}
Should be:
{{{
{"alignleft": [{"selector": "p,h1,etc", "styles": {"textAlign":"left"}}]}
}}}
Source:
https://core.trac.wordpress.org/browser/tags/4.7/src/wp-includes/class-wp-
editor.php#L525
Attaching patch for review.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40718>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list