[buddypress-trac] [BuddyPress] #4315: XML feeds not working

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Jun 29 17:05:05 UTC 2012


#4315: XML feeds not working
--------------------------+-----------------------------
 Reporter:  mnelson4      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Activity      |    Version:  1.5.4
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 I'm using buddypress 1.5.4 and was getting the following error when
 subscribing to any of the RSS feeds:
 "This page contains the following errors:  error on line 2 at column 6:
 XML declaration allowed only at the start of the document"
 (in Chrome, in Safari I was getting a different error).
 I inspected the feed's source and indeed found an extra blank line before
 the XML version declaration, which was invalidating the XML feed. So I
 hunted about, and found these blank lines at the start of the RSS feed
 files themselves (in buddypress/bp-activity/feeds). They occur at these
 lines:
 ------------------------------------
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'),
 true);
 header('Status: 200 OK');
 ?>
 <?php echo '<?xml version="1.0"
 encoding="'.get_option('blog_charset').'"?'.'>'; ?>
 --------------------------------------
 So I removed the extra line break to make the code look like this:
 ------------------------------------
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'),
 true);
 header('Status: 200 OK');
 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
 ?>
 --------------------------------------
 And it got rid of the error for me! Maybe you'll want to incorporate this
 change into newer versions?

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4315>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list