Kill spaces, avoid XML parsing error in WordPress

Today I learned a lesson in evil spaces.  My client’s WordPress feed was returning an XML parsing error telling me I had a line-break somewhere, something like:

XML Parsing Error: XML or text declaration not at start of entity
<?xml version="1.0" encoding="UTF-8"?>

Feed Validator – use it, live it, love it – confirmed this and hinted that I should check my rss, wp-config, and plugin files for extra line breaks or spaces outside the <?php ?> brackets.  Lo and behold a I found one teensy extra space after the closing php bracket on a custom sidebar widget I developed using the code from guff.  I’m sure if I was actually good at PHP I would have known apriori about malicious spaces.  Live and learn.

This entry was written by ross, posted on February 10, 2009 at 1:29 pm, filed under Blog. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Timeline

Have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

:

: