A classic: rss feeds with empty lines at the beginning

Having trouble installing serendipity?
Post Reply
eagle2l84
Posts: 2
Joined: Fri Apr 25, 2008 2:23 pm

A classic: rss feeds with empty lines at the beginning

Post by eagle2l84 »

I opened up a new blog using the just released 1.3.1 version. Everything works fine, except for the RSS feeds. Right now on some categories it works, but some have 1, others have 4 empty lines, and the global RSS feeds seem to have 5 empty lines, which result in validation errors when viewed with Firefox. (You're welcome to check yourself: http://crysis.jnana.de/ )

I have (originally) not edited any php file, except for the lang_en.inc.php file of the user profile pluging (to change Jabber ans Skype to Comrade and Xfire), The files were uploaded via WinSCP and are of the exact same size as locally, so they have not been changed during upload.

Meanwhile I found a few php files that I am sure are used in my case (for example the lua.php of GeSHi) which had empty lines after the closing ?> , and I changed them by removing the closing ?> entirely. However, nothing I did changed the problem in any way.

I also tried to temporarily disable all event plugins, but this also did not help, and not even change the numer of empty lines in the different feeds.

Where else can I look for the cause of this problem? I am totally at a loss here what else to do. Im about to disable the feeds completely cause i cant get them working.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: A classic: rss feeds with empty lines at the beginning

Post by garvinhicking »

Hi!

In which files did you have those new lines after ?> ?

And in the lang_en.inc.php file, did you also remove ?> to be sure it doesnot come fromthere?

Sadly PHP makes it VERY hard to backtrace these kind of problems. Also, remember that your RSS feed is cached! Try to open it via rss.php?nocache=true so that caching is disable and you can properly test your changes.

Because when I now tested your global feed, there are no linebreaks at the beginning.

(Also, writing an entry will clear your cache - or updating the entry's timestamp!)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
eagle2l84
Posts: 2
Joined: Fri Apr 25, 2008 2:23 pm

Re: A classic: rss feeds with empty lines at the beginning

Post by eagle2l84 »

garvinhicking wrote:In which files did you have those new lines after ?> ?

And in the lang_en.inc.php file, did you also remove ?> to be sure it doesnot come fromthere?
Sorry I can remember only one right now: serendipity_config_local.inc.php

Yes, i also removed it from lang_en.inc.php.

However, today i ran a grep over all files of serendipity, and there are lots of files ending in ?> followed by two or more newlines. Which prompts me to hint you to the wonderful utilities nawk and gawk, that you could use in your development process to automatically identify files with just a single <?php ... ?> bracket and remove the ?> if only white space follows.
However, just when i wanted to try your tips about nocache and so on, I began to feel really stupid. Why? Because suddenly everything works fine! All rss and atom feeds can be presented by firefox without problem. I am sure, that it was not only a cache problem, because it persisted even though i wrote a few articles, and yet today the problem is gone. I can no longer reproduce it, And so we may never learn, what the actual problem was.

So right now, I don't have a problem. But if the problem reappears, so will I. Until then, thank you anyway.

I don't know what made the problem disappear. One of my last actions last night on the blog, was removing all sticky flags, but when i tried to put back a sticky flag today, the feeds still worked.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: A classic: rss feeds with empty lines at the beginning

Post by garvinhicking »

Hi!

To me this sounds as if you might have used a bad FTP client to upload the files? in the original s9y files, there are no newlines after closing ?> lines...

But I'm happy to see that it somehow disappeared ;)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply