[wp-trac] [WordPress Trac] #21698: Remove HTML from __() in load.php and wp_set_wpdb_vars()

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 26 21:16:36 UTC 2012


#21698: Remove HTML from __() in load.php and wp_set_wpdb_vars()
-------------------------+-----------------------------
 Reporter:  mordauk      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  I18N         |    Version:
 Severity:  minor        |   Keywords:
-------------------------+-----------------------------
 When WP checks to see if there is an error with the DB prefix, it outputs
 a localized error with HTML in it:

 {{{
 wp_die( __( '<strong>ERROR</strong>: <code>$table_prefix</code> in <code
 >wp-config.php</code> can only contain numbers, letters, and underscores.'
 ) );
 }}}

 It'd be better to use sprintf() and add the HTML after localization via
 placeholders:
 {{{
 wp_die( sprintf( __( '%sERROR%s: %s$table_prefix%s in %swp-config.php%s
 can only contain numbers, letters, and underscores.', '<strong>',
 '</strong>', '<code>', '</code>', '<code>', '</code>' ) ) );
 }}}

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


More information about the wp-trac mailing list