[wp-trac] [WordPress Trac] #28786: wp_send_json silently fails on non UTF-8 strings
WordPress Trac
noreply at wordpress.org
Thu Oct 16 12:59:28 UTC 2014
#28786: wp_send_json silently fails on non UTF-8 strings
------------------------------+------------------
Reporter: pento | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.1
Component: General | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses:
------------------------------+------------------
Comment (by pento):
[attachment:28786.11.diff] now also sanity checks array/object keys.
And because we all like things that go faster, unwinding unnecessary
recursion gives us a bit of a boost when we need to sanity check the data.
{{{
$ php json_test.php
json_encode: 0.055270910263062
wp_json_encode overhead: 0.058070182800293
Best case wp_json_encode: 0.98551392555237
Worst case wp_json_encode: 4.3197019100189
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28786#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list