[wp-trac] [WordPress Trac] #20450: wp_dropdown_categories - inconsistent use of single-quotes causes (javascript) assignment issues

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 18 23:02:05 UTC 2012


#20450: wp_dropdown_categories - inconsistent use of single-quotes causes
(javascript) assignment  issues
-----------------------------+------------------------------
 Reporter:  rcain            |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:  3.3.1
 Severity:  minor            |  Resolution:
 Keywords:  has-patch close  |
-----------------------------+------------------------------
Changes (by nacin):

 * keywords:  has-patch => has-patch close


Comment:

 Replying to [ticket:20450 rcain]:
 > please could we have double-quote characters used consistently  in
 output? ideally provision of a javascript friendly output format (ie.
 backslash-newline) would also be great - though my no means essential.

 I don't really like this. We use single quotes all over in core, as often
 it is going to be a cleaner line of PHP code to use them (for example,
 when using variables inside double-quoted strings). While we could make
 this change, it would imply that we are then committing to always using
 double-quotes now and in the future, for all output functions. We simply
 cannot commit to that.

 If you want to use raw HTML output in JS, you should escape it or json-
 encode it.

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


More information about the wp-trac mailing list