WordPress.org

Make WordPress Core

#23014 closed defect (bug) (invalid)

template-loader.php process feeds and trackbacks bug

Reported by: cobrasjp14 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Feeds Keywords: needs-patch
Focuses: Cc:

Description

In the latest version of Wordpress, 3.5, the template-loader.php file has been changed and now processing feeds and trackbacks no longer functions correctly. I noticed this when trying to validate my RSS2 feed. The main blog page was concatenated to the RSS XML code. My site has Wordpress themes set to FALSE.

The problem is on lines 16, 19, and 22 where "exit();" was changed to "return;" When a feed is detected by the function is_feed(), the feed is then correctly output, however, by calling "return" and not "exit()", the rest of the php page is allowed to load. This effectively presents the RSS XML, then the page HTML to the browser.

This problem is repeatable each time an RSS2 feed for the blog is requested.

To correct this problem, change "return" on lines 16, 19, and 22, back to "exit()". This will prevent the rest of the HTML page from loading when a feed is detected. This will also correct the behavior when a robot or a trackback is detected.

Change History (2)

comment:1 helen16 months ago

  • Version changed from 3.5 to 2.2

exit was changed to return in [5104] for #3790

comment:2 nacin16 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

return stops processing in that file. template-loader.php is included from wp-blog-header.php, at the end, which is included from index.php, at the end.

Thus, return should prevent any additional output or execution.

I imagine this is a theme or plugin issue. Nothing in 3.5 has changed here.

Note: See TracTickets for help on using tickets.