[wp-trac] [WordPress Trac] #7149: prevent inadvertent output from included files

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 17 14:23:54 GMT 2008


#7149: prevent inadvertent output from included files
-------------------------+--------------------------------------------------
 Reporter:  mm6          |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.7      
Component:  General      |     Version:           
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 A couple days ago I accidentally broke all my feeds and XMLRPC by
 introducing a newline in my theme's functions.php file. This caused a
 newline before the xml declaration in the generated XML which breaks XML
 parsers.

 It got me thinking if there was a way to ignore the output from an
 included file that should never generate any output. What if the include
 was wrapped in this?

 {{{
 ob_start()
 include(STYLESHEETPATH . '/functions.php');
 ob_end_clean()
 }}}

 If anyone thinks is a good idea I can make a patch.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7149>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list