From 8d5149ccf03df87c40cfda9c6d2fb89f214da9cc Mon Sep 17 00:00:00 2001 From: "E. S." Date: Tue, 15 Apr 2025 01:55:35 +0300 Subject: [PATCH] fix rss again :) --- handlers/MainHandler.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/handlers/MainHandler.php b/handlers/MainHandler.php index 7548bd1..48aaea8 100644 --- a/handlers/MainHandler.php +++ b/handlers/MainHandler.php @@ -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) ];