#47470 closed defect (bug) (worksforme)
XML parsing error: undefined entity (revisited)
| Reported by: | RavanH | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Feeds | Version: | 5.2.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
Attachments (1)
Change History (8)
#3
in reply to: ↑ 2
@
7 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.
#4
@
6 weeks ago
Hi! It seems that this issue is no longer reproducible in current versions of WordPress.
I have tested this scenario using a clean environment in WP Playground. As far as I can see, when creating a tag with an apostrophe (L'apostrophe), the RSS feed output successfully wraps the term inside a CDATA block, preventing any incorrect entity conversion or broken XML structures:
<![CDATA[ L'apostrophe ]]>
I attach a screenshot (ticket-47470-proof.png) showing the source code of the general feed (/?feed=rss2) where this behavior can be verified. It looks like the bug is resolved.
#5
@
6 weeks ago
- Resolution → invalid
- Status new → closed
Yes, looks like it indeed. I'll mark this one as resolved (as invalid because I don't have regular fixed as an option) :)
#6
@
6 weeks ago
- Keywords needs-patch removed
- Milestone Awaiting Review
- Resolution invalid → worksforme
I switched to "works for me" since it cannot be reproduced now.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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 :/