Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 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:


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

Change History (4)

comment:1 @scribu5 years ago

  • Component changed from General to Formatting

comment:2 @azaozz5 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 @scribu5 years ago

  • Milestone Unassigned deleted

That's what I thought.

comment:4 @nacin5 years ago

Also cross-referencing wp_htmledit_pre() here.

Note: See TracTickets for help on using tickets.