[wp-trac] [WordPress Trac] #31190: esc_html() ate my ampersand

WordPress Trac noreply at wordpress.org
Sat Jan 31 19:02:16 UTC 2015


#31190: esc_html() ate my ampersand
--------------------------+-----------------------
 Reporter:  mdgl          |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Formatting    |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------
Changes (by mdgl):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 > – on input would not be equal to – on output simply
 because the ampersand in
 > this instance would (and should) be interpreted as a literal string
 &. It's basically
 > double-encoded, and esc_html() is not really meant to decode special
 characters in this way.

 Indeed, you are just confirming the bug. At the moment, `esc_html()`
 converts `–` to just `–` as my table shows. Like you, I
 believe it should remain as `–`.

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


More information about the wp-trac mailing list