RSS feed stopped working

Hi, I‘ve had my RSS feed implemented & running without changes for many years. It recently stopped working and I noticed that there is no <?xml ?> tag anymore.

The validator complains about exactly this, I think: Feed Validator Results: https://robert.katzki.de/rss

I have this block of code before the rest of the `site/templates/rss.php file and I suspect that something here is not working anymore:

<?php use \Kirby\Toolkit\Xml;

header('Content-Type: application/rss+xml');
header::type('application/rss+xml');
$kirby->response()->type('rss'); 

echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
  …

I’m using PHP 8.3 and also just tried upgrading to Kirby 4.6.1. It wasn‘t working with PHP 8.2 and Kirby 4.5 neither.

Any idea what could be wrong here? I appreciate any help. :slight_smile:

Anything in the PHP error logs? Couldn’t spot anything that directly looks off. On getkirby.com we are setting headers rather via $kirby->response()->header() but I also don’t think your way should be necessarily wrong.

Have you tried moving the <?xml> part from the echo to just after ?> as regular XML? Since the <rss> part seems to end up in the output somehow.

Hi & thanks for your help! I checked the error log for PHP and Apache as well as the access log. There is nothing wrong in there.

I tried moving the XML part to after the PHP, but it is not shown there either. I guess because of the short tags of the <?xml>.

In my feedreader, the last working entry was just before I upgraded from Kirby 4.4.1 to 4.5.0., so that seems to be the upgrade that introduced this error.

As I was digging through the commit with the Kirby upgrade, I realized that I installed kirby-minify-html at the same time – after removing it, it seems to work. At least I see the header and the <?xml> again. :see_no_evil:

Will open an issue in that project and live without it for now.