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

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 17 17:20:32 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:               |
-------------------------+------------------------

Comment (by azaozz):

 Replying to [comment:61 nacin]:
 > [attachment:wp_localize_script.test-case.diff] shows that
 wp_localize_script() escaping behavior has changed...
 >
 > The test works in 3.2, and fails in 3.3.

 Unfortunately you cannot "guess" how JS works from PHP. For this testcase
 to be relevant it will have to parse the JS and compare the output after
 that. This is possible to do with tools like Mozilla's Rhino. Currently
 this testcase will fail minimized JS too but (as we know) minimization
 works very well.

 > We can't wait until beta to see if any changes broke anything.

 Why? If we have to put the old (inconsistent and buggy) code back, we can
 do that at any time. There's no indication that using json breaks anything
 at the moment, however I'm sure we will find newly introduced bugs and
 regressions in many places while beta-testing.

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


More information about the wp-trac mailing list