Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 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)

#1 @scribu
12 years ago

  • Component changed from General to Formatting

#2 @azaozz
12 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.

#3 @scribu
12 years ago

  • Milestone Unassigned deleted

That's what I thought.

#4 @nacin
12 years ago

Also cross-referencing wp_htmledit_pre() here.

Note: See TracTickets for help on using tickets.