use correct FeedOptions methods. fixes #4203

This makes feed.php use the correct methods for setting the feed type
and content-type header. It also adds the missing type definition for
RSS 1.0
This commit is contained in:
Andreas Gohr 2024-02-11 10:11:45 +01:00
parent 7a9c51a02e
commit 7e23bd088a
3 changed files with 6 additions and 2 deletions

View File

@ -52,7 +52,7 @@ $depends['purge'] = $INPUT->bool('purge');
// time or the update interval has not passed, also handles conditional requests
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Type: ' . $options->get('mime_type'));
header('Content-Type: ' . $options->getMimeType());
header('X-Robots-Tag: noindex');
if ($cache->useCache($depends)) {
http_conditionalRequest($cache->getTime());

View File

@ -63,7 +63,7 @@ class FeedCreator
}
$event->advise_after();
return $this->feed->createFeed($this->options->get('type'));
return $this->feed->createFeed($this->options->getType());
}
/**

View File

@ -15,6 +15,10 @@ class FeedCreatorOptions
'name' => 'RSS0.91',
'mime' => 'text/xml; charset=utf-8',
],
'rss1' => [
'name' => 'RSS1.0',
'mime' => 'text/xml; charset=utf-8',
],
'rss2' => [
'name' => 'RSS2.0',
'mime' => 'text/xml; charset=utf-8',