[wp-trac] [WordPress Trac] #53936: Output of serialize_block_attributes does not match equivalent Gutenberg function

WordPress Trac noreply at wordpress.org
Mon Aug 16 19:38:13 UTC 2021


#53936: Output of serialize_block_attributes does not match equivalent Gutenberg
function
--------------------------+------------------------------
 Reporter:  kevinfodness  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by SergeyBiryukov):

 * component:  General => Editor


Comment:

 Hi there, welcome to WordPress Trac! Thanks for a detailed bug report.

 Replying to [ticket:53936 kevinfodness]:
 > Related: Is there a reason why we are using `json_encode` here rather
 than `wp_json_encode`? As near as I can tell, this is the only location in
 WordPress core source code that uses `json_encode` other than the
 `wp_json_encode` function itself. Assuming this is in error, I'll make
 that change in my patch as well.

 Good catch, this seems like an oversight. Per [30055] / #28786, any
 `json_encode()` calls in core should indeed be converted to
 `wp_json_encode()`,  as the former can fail if the data contains any non
 UTF-8 characters.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53936#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list