Trailing whitespace in WP Core Files
-
I found an inability to write a cookie in a theme template file and traced the WP startup from index.php through my theme, to find where output was getting generated. There are a couple of files in the WP core that are generating whitespace:
wp-blog-header.php
wp-load.php
wp-trackback.php
wp-includes/template-loader.phpI recommend removing the closing PHP tag, per the Zend coding standard:
For files that contain only PHP code, the closing tag (“?>”) is never permitted. It is not required by PHP, and omitting it prevents the accidental injection of trailing white space into the response.
I searched on the bug trac but couldn’t find this one. Should I submit it? Or can an admin confirm? Thanks –
The topic ‘Trailing whitespace in WP Core Files’ is closed to new replies.