[wp-trac] [WordPress Trac] #30613: Check the return value of wp_json_encode()

WordPress Trac noreply at wordpress.org
Sat Dec 6 10:08:14 UTC 2014


#30613: Check the return value of wp_json_encode()
--------------------------+----------------------------
 Reporter:  pento         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
--------------------------+----------------------------
 It's possible for `wp_json_encode()` to return `false`, same as
 `json_encode()`. Everywhere in core, this will cause either invalid JS to
 be produced, or invalid JSON to be returned to an ajax call.

 We need to sanity check the return value, and switch `false` for an
 appropriate response.

 This ticket is branched from discussion in #28786.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30613>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list