WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12178 closed defect (bug) (invalid)

esc_html() doesn't encode '&' characters

Reported by: scribu Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Formatting Keywords: 2nd-opinion
Focuses: Cc:

Description

var_dump(htmlspecialchars('«'));	// string(11) "«"
var_dump(esc_html('«'));		// string(7) "«"

Change History (4)

comment:1 @scribu6 years ago

  • Component changed from General to Formatting

comment:2 @azaozz6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

You mean it doesn't double-encode it? This is by design, if something needs double-encoding use htmlspecialchars.

comment:3 @scribu6 years ago

  • Milestone Unassigned deleted

That's what I thought.

comment:4 @nacin6 years ago

Also cross-referencing wp_htmledit_pre() here.

Note: See TracTickets for help on using tickets.