01273: RSS feed has extraneous newline in line 1

Summary: RSS feed has extraneous newline in line 1
Created: 2011-11-29 15:44
Status: Closed - not a bug
Category: Bug
From: Jboy
Assigned:
Priority: 1
Version: 2.2.35
OS: NetBSD 5.1/Apache 2.2.20/PHP 5.3.6

Description: I am creating an RSS feed for a category using

  .../pmwiki/Category/Posters?action=rss&sort=-time (see http://occuprint.org/feed)

That works without a hitch, except that the resulting RSS feed has a superfluous blank line at the beginning, causing some of the stricter feed parsers (including Feedburner) to choke.

In my config/local.php, I have the following:

  if ($action == 'rss') include_once("$FarmD/scripts/feeds.php");
  $FeedFmt['rss']['feed']['rights'] = 'Creative Commons BY-NC-SA 3.0';
  $FeedFmt['rss']['item']['title'] = '01273';
  if ($action == 'rss')
      SDVA($_REQUEST, array(
      'order' => '-time',
      'count' => 100));

It works here, so you may want to check your PHP files in the local/ and in the cookbook/ directory: they should not have empty new lines before the first <?php and they should not contain a closing ?> marker, see Design Notes. --Petko November 30, 2011, at 01:54 AM

Aha! ?> appeared in two PHP files in my cookbook directory, and after removing the markers, the problem has gone away. Thanks! Jboy