Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#32620 closed defect (bug) (wontfix)

WordPress is not stripping invalid tags in get_the_content_feed

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

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
11 years ago

  • Severity normalminor

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.

Version 1, edited 11 years ago by stevenkword (previous) (next) (diff)

#2 @samuelsidler
11 years ago

  • Summary Wordpress is not stripping invalid tags in get_the_content_feedWordPress is not stripping invalid tags in get_the_content_feed

#3 @stevenkword
11 years ago

  • Keywords needs-unit-tests added

#4 @stevenkword
11 years ago

  • Keywords needs-patch added

#5 @stevenkword
10 years ago

  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status newclosed
Note: See TracTickets for help on using tickets.