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

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 17 12:50:50 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:               |
-------------------------+------------------------
Changes (by scribu):

 * keywords:  revert =>


Comment:

 The important thing to test isn't wether the strings look the same in the
 HTML source, but that they have the same value when they're actually
 loaded into JavaScript.

 In the HTML, wether you write:

 {{{
 var x = "a\'s";
 }}}

 or

 {{{
 var x = "a's";
 }}}

 in JavaScript, the value will be the same in both cases: {{{a's}}}.

 Therefore, [attachment:wp_localize_script.test-case.diff] is not a
 relevant test, nor the fact that non-ascii characters are now escaped.

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


More information about the wp-trac mailing list