Make WordPress Core

Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#16466 closed defect (bug) (fixed)

HTML in comments results in invalid XML in comments feed

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

Description

HTML in comments results in invalid XML in comments feed

Patch attached

Attachments (2)

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

Download all attachments as: .zip

Change History (7)

@barry
14 years ago

#1 @hakre
14 years ago

atom comment feed already uses CDATA

@nacin
14 years ago

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

#2 @nacin
14 years ago

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

Looks good.

#3 @nacin
12 years ago

  • Component changed from General to Feeds
  • Keywords commit added
  • Milestone changed from Future Release to 3.5

#4 @markjaquith
12 years ago

  • 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

#5 @mdgl
12 years ago

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.