fix rss again :)

This commit is contained in:
E. S. 2025-04-15 01:55:35 +03:00
parent 984ba3f1b2
commit 8d5149ccf0

View File

@ -147,11 +147,14 @@ class MainHandler extends request_handler {
global $config;
$lang = PostLanguage::getDefault();
$items = array_map(function(Post $post) use ($lang) {
$items = array_map(function(Post $post) use ($lang, $config) {
$pt = $post->getText($lang);
$url = $post->getUrl();
if (!str_starts_with($url, 'https://'))
$url = 'https://'.$config['domain'].$url;
return [
'title' => $pt->title,
'link' => $post->getUrl(),
'link' => $url,
'pub_date' => date(DATE_RSS, $post->getTimestamp()),
'description' => $pt->getDescriptionPreview(500)
];