Opened 4 years ago
Last modified 7 months ago
#9993 new defect (bug)
Rss and atom feeds are dropping some characters
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Feeds | Version: | 2.7.1 |
| Severity: | normal | Keywords: | has-patch needs-testing needs-unit-tests |
| Cc: | pm24601, mdhansen@… |
Description
Blog post with title:
& > test <
has the less than ( < ) is stripped from the atom and rss feed.
Attachments (1)
Change History (18)
comment:2
redsweater — 4 years ago
- Keywords needs-patch added
- Milestone changed from Unassigned to 2.8
See also #9992
comment:5
peaceablewhale — 4 years ago
- Component changed from XML-RPC to Feeds
- Keywords has-patch added; needs-patch removed
- Owner josephscott deleted
The PHP's built-in "strip_tags" function has caused the error. It also seems not necessary to have it applied to the_title_rss(). I have uploaded a patch to remove it.
trouble with the patch is the strip_tags() call might be there for a reason. isn't it possible to have html in a post title?
- Milestone changed from 2.8 to 2.9
punting per IRC discussion
comment:8
peaceablewhale — 4 years ago
Yes. However, WordPress will escape the HTML (via the "ent2ncr" function) and therefore they are no longer HTML.
I think calling strip_tags is problmatic because an author can have a post title like "Use <h1> to <h6> for headings, <p> for paragraphy, but not formatting". strip_tags will remove the HTML unexpectedly.
- Keywords needs-review added
some core dev feedback would be useful here
comment:10
peaceablewhale — 4 years ago
The priorities of ent2ncr are no longer modified by the patch. The new patch only removes the unnecessary 'strip_tags' filter.
comment:11
peaceablewhale — 4 years ago
- Keywords needs-testing added; needs-review removed
Marking this report "needs-testing" in order to gain attention in the upcoming bug hunt.
comment:12
ryan — 3 years ago
- Milestone changed from 2.9 to 3.0
There are other areas where we need a smarter strip. Let's figure it out in 3.0.
comment:13
dd32 — 3 years ago
- Keywords early added
- Milestone changed from 3.0 to 3.1
Punting due to impending beta
peaceablewhale — 3 years ago
comment:14
peaceablewhale — 3 years ago
Patch updated for 3.1.
"& > test <" now works even without the patch, but "<test>This is a test</test>" not.
I still think there is no reason for having 'strip_tags' in feed title as they are escaped already.
comment:15
nacin — 3 years ago
- Keywords 3.2-early added; early removed
- Milestone changed from Awaiting Triage to Future Release
Bumping once more.
comment:16
MikeHansenMe — 7 months ago
- Cc mdhansen@… added
- Keywords 3.2-early removed
I was able to reproduce the problem in trunk (3.5-beta2-22252). Confirmed the patch fixes the problem.
comment:17
nacin — 7 months ago
- Keywords needs-unit-tests added

Confirmed in WordPress trunk. The test case example loses the final "<" character, specifically the final output in the feed looks like:
<![CDATA[& > test ]]>