Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 12 years ago

#4315 closed defect (bug) (fixed)

XML feeds not working

Reported by: mnelson4's profile mnelson4 Owned by: fanquake's profile fanquake
Milestone: 1.7 Priority: normal
Severity: normal Version: 1.5.4
Component: Activity Keywords: has-patch reporter-feedback
Cc: fanquake@…

Description

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?

Attachments (1)

xml-feeds-php-tags.patch (4.0 KB) - added by fanquake 12 years ago.

Download all attachments as: .zip

Change History (6)

#1 @boonebgorges
13 years ago

  • Keywords 1.7-early added
  • Milestone changed from Awaiting Review to Future Release

Good catch. Let's do this right after 1.6.

#2 @boonebgorges
12 years ago

  • Keywords has-patch added; 1.7-early removed
  • Milestone changed from Future Release to 1.7

#3 @DJPaul
12 years ago

  • Keywords reporter-feedback added

How do I recreate this issue? Both Safari 6 and Chrome want me to install separate RSS feed readers, and Firefox doesn't throw an error.

#4 @fanquake
12 years ago

  • Cc fanquake@… added
  • Owner set to fanquake
  • Status changed from new to assigned

#5 @djpaul
12 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [6348]) Remove whitespace potentially breaking XML feeds. Fixes #4315, props fanquake

Note: See TracTickets for help on using tickets.