[wp-trac] [WordPress Trac] #30133: Twenty Fifteen: minor file cleanup

WordPress Trac noreply at wordpress.org
Tue Oct 28 21:30:58 UTC 2014


#30133: Twenty Fifteen: minor file cleanup
---------------------------+------------------
 Reporter:  lancewillett   |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  4.1
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+------------------

Comment (by ocean90):

 Replying to [comment:4 lancewillett]:
 > In [changeset:"30044"]:
 > {{{
 > #!CommitTicketReference repository="" revision="30044"
 > Twenty Fifteen: escape variable in HTML attribute output in customer
 header. See #30133.
 > }}}


 `esc_attr()` is just for attributes, because it escapes the quotes.

 {{{
 var_dump(' style="color: #fff;"' === esc_attr( ' style="color: #fff;"') );
 // false
 var_dump(' style="color: #fff;"' === ' style="' . esc_attr( 'color:
 #fff;') . '"' ); // true
 }}}

 So in line 152 `sprintf( ' style="color: #%s;"', esc_attr(
 get_header_textcolor() ) );` should be fine.

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


More information about the wp-trac mailing list