Opened 6 years ago
Last modified 6 years ago
#47470 new defect (bug)
XML parsing error: undefined entity (revisited)
Reported by: | 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)
#3
in reply to:
↑ 2
@
6 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
’
(invalid) but on others to’
(valid).
’
is a translatable string in wptexturize()
, so some locales may have translated it to ’
.
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.
Strange, I tested on several other installations and on some the single quote gets converted to
’
(invalid) but on others to’
(valid). Switching PHP version from 7.1 to 7.2 to 7.3, Nginx or Apache, I see no consistency in the behavior :/