Separate feed type detection from init, don't subscribe on failures.

Also some FeedParser tweaks.
This commit is contained in:
wn_
2025-06-22 16:31:50 +00:00
parent 46e05583a9
commit 0cd788220d
4 changed files with 85 additions and 67 deletions

View File

@@ -305,9 +305,8 @@ class RSSUtils {
if ($feed_data) {
$rss = new FeedParser($feed_data);
$rss->init();
if (!$rss->error()) {
if ($rss->init()) {
$basic_info = [
'title' => mb_substr(clean($rss->get_title()), 0, 199),
'site_url' => mb_substr(UrlHelper::rewrite_relative($feed->feed_url, clean($rss->get_link())), 0, 245),
@@ -590,9 +589,8 @@ class RSSUtils {
}
$rss = new FeedParser($feed_data);
$rss->init();
if (!$rss->error()) {
if ($rss->init()) {
Debug::log("running HOOK_FEED_PARSED handlers...", Debug::LOG_VERBOSE);