Page 1 of 1

problem with my rss-feed

Posted: Thu Nov 16, 2006 11:41 pm
by stm999999999
I have a problem with my feeds on my new site (http://www.s9y.org/forums/viewtopic.php?t=7699):
Fehler:XML declaration not at beginning of document
Spezifikation:http://www.w3.org/TR/REC-xml/
1:
2:
3: <?xml version="1.0" encoding="utf-8" ?>
4: <?xml-stylesheet href="/templates/default/atom.css" type="text/css" ?>
5:
6: <feed
it does not matter if I use rss2 or atom ...

I do not have any (changed) feed-tpls in my template, s9y uses the default ones. If I choose another template (or the origin of my changed one, artistic) everything is fine.

Do you have any idea for this error? Why are there two empty lines?

Re: problem with my rss-feed

Posted: Fri Nov 17, 2006 1:35 pm
by garvinhicking
Hi!

I think that one of your files emits blank space. Check all your manually modified files if they have blank lines or linebreaks before the first <?php or after the last ?>.

Especially custom language files, theme config files or plugins can cause this. Often even a WINDOWS-Style linebreak can introduce that error. We suggest to not put a closing "?>" in files to prevent a problem with padding newlines.

Best regards,
Garvin

Posted: Fri Nov 17, 2006 3:20 pm
by stm999999999
I think it could not be a plugin or so, because after changing the template all works well.

So it should be an error of my template.

In what kind of files should I search? only.php or even .tpl, or ...?

Posted: Fri Nov 17, 2006 3:27 pm
by garvinhicking
Hi!

PHP files only.

HTH,
Garvin

Posted: Fri Nov 17, 2006 6:32 pm
by stm999999999
thanks, I found it in my lang_de.inc.php.

But it is a little bit mysterious: It is the normal lang-file. The utf-8-lang-file was OK and my blog uses utf-8. Why has an error in the normal lang an effect to a utf-8-blog?

Posted: Sat Nov 18, 2006 8:14 pm
by garvinhicking
Hi!

In which file exactly? Ofyour template or of the blog?

Regards,
Garvin

Posted: Sat Nov 18, 2006 10:12 pm
by stm999999999
in my template lang-file, with $serendipity['useTemplateLanguage'] = true;

Posted: Sat Nov 18, 2006 10:41 pm
by garvinhicking
Hi!

Hm...okay. I don't recall the code for that useTemplateLanguage stuff, so itwould need to be investigated why the-non-utf8 version could be included...

Maybe it's also your templates config.inc.php fiel that is loading this lang file...?

Regards,
Garvin

Posted: Sun Nov 19, 2006 12:49 am
by stm999999999
Hm...okay. I don't recall the code for that useTemplateLanguage stuff, so itwould need to be investigated why the-non-utf8 version could be included...

Code: Select all

    // The following variable can be set in serendipity_config_local.inc.php to force your templates being able to use language override includes
    if ($serendipity['useTemplateLanguage']) {
        @include (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/' . $charset .  'lang_' . $serendipity['lang'] . '.inc.php');
        @include (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/lang_en.inc.php');
    }
Maybe it's also your templates config.inc.php fiel that is loading this lang file...?

Code: Select all

$probelang = dirname(__FILE__) . '/lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
    include $probelang;
} else {
    include dirname(__FILE__) . '/lang_en.inc.php';
}
hm, a "$charset" there would be fine?

Posted: Sun Nov 19, 2006 2:21 am
by garvinhicking
Hi!

So its definitely your templates config.inc.php. In your case, yes, you'd needto add a $serendipity['charset'] in there.

Regards,
Garvin

Posted: Sun Nov 19, 2006 4:15 pm
by stm999999999
why not "$charset" as in the lang.inc.php?


BTW, this fault is not only in my config.php. It is in "artistic" on which my templated based, and it is in kubrick and pink_lilies ...

It seems to me that this is in every template with a config.php

Posted: Sun Nov 19, 2006 6:34 pm
by garvinhicking
Hi!

Because $charset is not a superglobal value and only available in local scope in lang.inc.php.
BTW, this fault is not only in my config.php. It is in "artistic" on which my templated based, and it is in kubrick and pink_lilies ...
I guess then this was introduced before the UTF-8 charset was available. I also don'T know which templates already have a utf-8 translation. If someone can contribute a GNU patch for all affected templates I can commit the fix!

Best regards,
Garvin