Opened 2 years ago

Closed 11 months ago

Last modified 9 months ago

#16466 closed defect (bug) (fixed)

HTML in comments results in invalid XML in comments feed

Reported by: barry Owned by: markjaquith
Priority: normal Milestone: 3.5
Component: Feeds Version:
Severity: normal Keywords: has-patch 3.2-early commit
Cc:

Description

HTML in comments results in invalid XML in comments feed

Patch attached

Attachments (2)

16466.diff (749 bytes) - added by barry 2 years ago.
16466.2.diff (784 bytes) - added by nacin 2 years ago.
Patch from bazza, diff'd from root, and without trailing spaces.

Download all attachments as: .zip

Change History (7)

barry2 years ago

atom comment feed already uses CDATA

nacin2 years ago

Patch from bazza, diff'd from root, and without trailing spaces.

  • Keywords has-patch 3.2-early added
  • Milestone changed from Awaiting Review to Future Release

Looks good.

  • Component changed from General to Feeds
  • Keywords commit added
  • Milestone changed from Future Release to 3.5
  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In [21238]:

Use a CDATA section for RSS2 comments feeds, so HTML in comments doesn't kill XML validation. props bazza. fixes #16466

We have a default filter of esc_html() declared against comment_text_rss() so shouldn't this have already solved the problem?

That said, we're using CDATA blocks in most related areas (e.g. post content, excerpts), so perhaps it's more consistent to use them here as well.

An issue remains however in the use of comment_text_rss() as this doesn't apply all of the expected filters (e.g. wpautop). I suspect it might be better to deprecate comment_text_rss() and use just comment_text() as elsewhere in the RSS2 and Atom feeds. See also #21753 for a similar issue with the use of excerpts in feeds.

Note: See TracTickets for help on using tickets.