WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 20 months ago

#21753 new defect (bug)

Feed excerpts are missing important filter formatting

Reported by: mdgl Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.4.1
Component: Feeds Keywords: has-patch needs-testing needs-unit-tests
Focuses: Cc:

Description

Excerpts included in feeds are missing important formatting because the relevant filters are not applied (e.g. wpautop).

In file wp-includes/feed.php, function the_excerpt_rss() does not apply the same filters as the_excerpt() whilst results in lost formatting instructions. By comparison, function the_content_feed() ensures that the same filters declared for the_content() are applied.

A suggested patch is attached. Note that for symmetry between the_excerpt_rss() and the_content_feed() this patch also removes the (unnecessary?) filter ent2ncr() from the_excerpt_rss() and retains the (controversial?) escaping for CDATA blocks (see #3670).

A few related issues are worth mentioning. Firstly, shortcodes are still not applied to excerpts (see #7093). Also, the (obsolete?) RDF feed does not make use of a CDATA block unlike those for RSS, RSS2 and Atom (see #20888). Finally, a similar problem occurs with comment text in feeds (see #16466).

Attachments (3)

21753.diff (1.3 KB) - added by mdgl 5 years ago.
21753.2.diff (1.1 KB) - added by mdgl 4 years ago.
21753.patch (1.3 KB) - added by chriscct7 2 years ago.

Download all attachments as: .zip

Change History (9)

@mdgl
5 years ago

#1 @raamdev
4 years ago

  • Keywords needs-refresh added

@mdgl Thanks for the report. I'm sorry that you never got a reply on this!

I tried testing your patch but it did not apply cleanly for me. Could you please submit an updated patch?

@mdgl
4 years ago

#2 @mdgl
4 years ago

Patch refreshed for trunk. Earlier caveats still apply. It remains both surprising and disappointing that WordPress doesn't have a clean and consistent way of dealing with fundamental concepts such as the_content and the_excerpt. We mess with this stuff far too much and in different ways.

This ticket was mentioned in IRC in #wordpress-dev by raamdev. View the logs.


4 years ago

#4 @raamdev
4 years ago

  • Keywords has-patch needs-testing added; needs-refresh removed

@mdgl Thank you for the updated patch. I've confirmed that it applies cleanly to trunk.

@chriscct7
2 years ago

#5 @chriscct7
2 years ago

Refreshed patch

#6 @stevenkword
20 months ago

  • Keywords needs-unit-tests added
Note: See TracTickets for help on using tickets.