[wp-trac] [WordPress Trac] #43010: Attribute Name Escape

WordPress Trac noreply at wordpress.org
Fri Jan 7 23:09:37 UTC 2022


#43010: Attribute Name Escape
-------------------------------------+------------------------------
 Reporter:  joe_bopper               |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Formatting               |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------------

Comment (by sc0ttkclark):

 Should this function use dash or underscore? Right now it's using
 underscore and it feels like dash may be more consistent with the data-*
 standard.

 I also was doing some checking and there are multiple areas in WP core
 which output attribute names without any escaping.

 You can find a number of cases in the WP core files by searching for: `.
 '="'`

 You'll find lots of usage like this:

 `$attr_strings[] = $k . '="' . esc_attr( $v ) . '"';`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43010#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list