[wp-trac] [WordPress Trac] #28816: HTML entities in post titles break feeds
WordPress Trac
noreply at wordpress.org
Fri Jan 23 14:26:08 UTC 2015
#28816: HTML entities in post titles break feeds
--------------------------+------------------------------
Reporter: blowery | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Feeds | Version: 3.9.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by mdgl):
Good bug report, and I can confirm that the problem is still present in
4.1
In this case, I think there are actually three separate issues:
* Function `ent2ncr()` is being too aggressive by substituting the
standard XML entities with their numeric equivalents. Although this is not
totally incorrect, it is unnecessary and this function should really only
need to replace the HTML entities that are not defined in XML.
* Function `esc_html()` should not be used for generating feed output as
it only performs a "single encode" rather than the "double encode" that is
needed for including HTML within XML. For some background on this, see
http://php.net/manual/en/function.htmlspecialchars.php.
* There is a bug in function `esc_html()` which means it effectively
"eats" the string "&" when this is followed by text that looks like a
valid HTML entity.
Since this ticket is largely about feeds, I suggest we create a new ticket
for the third issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28816#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list