X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=include%2Frssfuncs.php;h=4c3e861237349a105af107e21225c25f868a9a06;hb=6791af0cfdf481e90368b92c358559dcc6944272;hp=70414ccaae0022616295896bf9dab7ebde8adf2b;hpb=0ad2013bd24eb14bfd0a1c6f9a01745a6b04f58a;p=tt-rss.git diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 70414cca..4c3e8612 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -242,9 +242,16 @@ $cache_filename = CACHE_DIR . "/simplepie/" . sha1($fetch_url) . ".xml"; + $pluginhost = new PluginHost(); + $pluginhost->set_debug($debug_enabled); + $user_plugins = get_pref("_ENABLED_PLUGINS", $owner_uid); + + $pluginhost->load(PLUGINS, PluginHost::KIND_ALL); + $pluginhost->load($user_plugins, PluginHost::KIND_USER, $owner_uid); + $pluginhost->load_data(); + $rss = false; $rss_hash = false; - $cache_timestamp = file_exists($cache_filename) ? filemtime($cache_filename) : 0; $force_refetch = isset($_REQUEST["force_refetch"]); @@ -267,6 +274,10 @@ if (!$rss) { + foreach ($pluginhost->get_hooks(PluginHost::HOOK_FETCH_FEED) as $plugin) { + $feed_data = $plugin->hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed); + } + if (!$feed_data) { _debug("fetching [$fetch_url]...", $debug_enabled); _debug("If-Modified-Since: ".gmdate('D, d M Y H:i:s \G\M\T', $last_article_timestamp), $debug_enabled); @@ -330,16 +341,8 @@ } } - $pluginhost = new PluginHost(); - $pluginhost->set_debug($debug_enabled); - $user_plugins = get_pref("_ENABLED_PLUGINS", $owner_uid); - - $pluginhost->load(PLUGINS, PluginHost::KIND_ALL); - $pluginhost->load($user_plugins, PluginHost::KIND_USER, $owner_uid); - $pluginhost->load_data(); - foreach ($pluginhost->get_hooks(PluginHost::HOOK_FEED_FETCHED) as $plugin) { - $feed_data = $plugin->hook_feed_fetched($feed_data, $fetch_url, $owner_uid); + $feed_data = $plugin->hook_feed_fetched($feed_data, $fetch_url, $owner_uid, $feed); } // set last update to now so if anything *simplepie* crashes later we won't be