WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 17 months ago

#32620 closed defect (bug) (wontfix)

WordPress is not stripping invalid tags in get_the_content_feed

Reported by: juniorm Owned by:
Milestone: Priority: normal
Severity: minor Version: 4.2.2
Component: Feeds Keywords: needs-unit-tests needs-patch
Focuses: administration Cc:

Description

I think that maybe get_the_content_feed does not stript invalid tags from post content. I have posted a question about it in here: http://wordpress.stackexchange.com/questions/191199/does-get-the-content-feed-strip-invalid-tags

I have an iframe within a post body content, and wordpress feed is not working anymore.

Possible solutions

1) When generating rss feed maybe would be nicer to add more functions to strip those invalid tags, sanitize the string, and also remove shortcodes [bla] blabla [\/bla]

2) or... you could add a menu option in Wordpress panel to fine tune how feed would be generated. You could choose if invalid tags should be removed or not, so the feed would contain only plain text in <content>

Change History (5)

#1 in reply to: ↑ description @stevenkword
3 years ago

  • Severity changed from normal to minor

Thank you for the detailed bug report!

Replying to juniorm:

I think that maybe get_the_content_feed does not stript invalid tags from post content. I have posted a question about it in here: http://wordpress.stackexchange.com/questions/191199/does-get-the-content-feed-strip-invalid-tags

I have an iframe within a post body content, and wordpress feed is not working anymore.

I have just used the iframe from your stackexchange example and my browser is not throwing errors. I see that the w3c validator is issuing a warning, but this is not a validation error and your feed should be functional.

2) or... you could add a menu option in Wordpress panel to fine tune how feed would be generated. You could choose if invalid tags should be removed or not, so the feed would contain only plain text in <content>

This might make for a good plugin. We should aim to make decisions and not options. However we can provide a way to extend our decisions to allow for more options.

Since the feed isn't throwing errors, it would hard to make and argument for stripping out the tags that so many content providers depend on. This might be related to how we are encoding feeds though. There are other problems that we know about related to CDATA, and I'm beginning to think we should get rid of CDATA all together in favor of an "escape everything" philosophy.

Last edited 3 years ago by stevenkword (previous) (diff)

#2 @samuelsidler
3 years ago

  • Summary changed from Wordpress is not stripping invalid tags in get_the_content_feed to WordPress is not stripping invalid tags in get_the_content_feed

#3 @stevenkword
2 years ago

  • Keywords needs-unit-tests added

#4 @stevenkword
2 years ago

  • Keywords needs-patch added

#5 @stevenkword
17 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.