[wp-trac] [WordPress Trac] #19830: wp_localize_script() combines statements improperly

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 13 22:51:03 UTC 2012


#19830: wp_localize_script() combines statements improperly
--------------------------+-----------------------------
 Reporter:  TobiasBg      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.3
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-----------------------------
 When making multiple calls to {{{wp_localize_script()}}} on the same
 {{{$handle}}}, the individual JSONified objects are merged together with
 {{{;\n}}} [http://core.trac.wordpress.org/browser/trunk/wp-includes/class
 .wp-scripts.php#L151 in this line].
 However, each individual {{{var}}} statement has already been correctly
 terminated by a semicolon {{{;}}}
 [http://core.trac.wordpress.org/browser/trunk/wp-includes/class.wp-
 scripts.php#L143 a few lines above].

 Due to that, the resulting output has an extra semicolon after each but
 the last {{{var}}} statement (i.e. {{{;;}}}).

 Removing the semicolon from the string in
 [http://core.trac.wordpress.org/browser/trunk/wp-includes/class.wp-
 scripts.php#L151 line 151] should fix this.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19830>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list