Opened 9 years ago
Closed 8 years 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)
Note: See
TracTickets for help on using
tickets.
Thank you for the detailed bug report!
Replying to juniorm:
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.
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.