[wp-trac] [WordPress Trac] #11520: print_scripts_l10n() should use json_encode()

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 17 07:25:42 UTC 2011


#11520: print_scripts_l10n() should use json_encode()
-------------------------+------------------------
 Reporter:  scribu       |       Owner:  azaozz
     Type:  enhancement  |      Status:  reviewing
 Priority:  normal       |   Milestone:  3.3
Component:  JavaScript   |     Version:
 Severity:  critical     |  Resolution:
 Keywords:  revert       |
-------------------------+------------------------
Changes (by nacin):

 * keywords:  has-patch dev-feedback => revert
 * severity:  normal => critical


Comment:

 [attachment:wp_localize_script.test-case.diff] shows that
 wp_localize_script() escaping behavior has changed from 3.2 to 3.3. The
 test is janky, as it has to parse JS output, but the result is clear, and
 illustrates what [comment:53] outlined.

 The test works in 3.2, and fails in 3.3. This convinces me that we should
 leave wp_localize_script() alone and switch to wp_add_script_data().

 We can't wait until beta to see if any changes broke anything. It's better
 to be proactive about avoiding any backwards incompatible changes, no
 matter how small they may seem.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11520#comment:61>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list