Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#47470 new defect (bug)

XML parsing error: undefined entity (revisited)

Reported by: ravanh's profile RavanH Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.2.1
Component: Feeds Keywords: needs-patch
Focuses: Cc:

Description

After 10 years, bug #8464 seems to be back in 5.2.1
On a completely fresh install (no plugins, default theme) I added a tag with a ' (single quote) in the title. This converts to ’ in the feed title. This in turn, generates

This feed does not validate.

line 11, column 9: XML parsing error: <unknown>:11:9: undefined entity

for the tag's feed on https://validator.w3.org/feed/

See https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2F2607.fr%2Ftag%2Flapostrophe%2Ffeed%2F for example

Change History (3)

#1 @swissspidy
5 years ago

  • Component changed from I18N to Feeds

#2 follow-up: @RavanH
5 years ago

Strange, I tested on several other installations and on some the single quote gets converted to &rsquo; (invalid) but on others to &#8217; (valid). Switching PHP version from 7.1 to 7.2 to 7.3, Nginx or Apache, I see no consistency in the behavior :/

Last edited 5 years ago by RavanH (previous) (diff)

#3 in reply to: ↑ 2 @SergeyBiryukov
5 years ago

  • Keywords needs-patch added

Replying to RavanH:

Strange, I tested on several other installations and on some the single quote gets converted to &rsquo; (invalid) but on others to &#8217; (valid).

&#8217; is a translatable string in wptexturize(), so some locales may have translated it to &rsquo;.

For feeds, we generally run the content through ent2ncr and other filters to prevent this kind of issues. Looks like in addition to post titles we have to run it on term titles as well.

Note: See TracTickets for help on using tickets.