X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=include%2Frssfuncs.php;h=9c80a72d6efc7035ac9151fc27afd8cccb516b9f;hb=1ffe3391f902c4baa984982f19e61a0e45de21ff;hp=537a4c338c54598bac4f4793a1d03a9c27b2a1e3;hpb=d0d86316ee5db103afcc77406e45abb26a1978ea;p=tt-rss.git diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 537a4c33..9c80a72d 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -127,8 +127,6 @@ $updstart_thresh_qpart ORDER BY $random_qpart $query_limit"); - $user_prefs_cache = array(); - if($debug) _debug(sprintf("Scheduled %d feeds to update...", db_num_rows($result))); // Here is a little cache magic in order to minimize risk of double feed updates. @@ -304,6 +302,14 @@ $no_cache ? FEED_FETCH_NO_CACHE_TIMEOUT : FEED_FETCH_TIMEOUT, $force_refetch ? 0 : max($last_updated_timestamp, $cache_timestamp)); + global $fetch_curl_used; + + if (!$fetch_curl_used) { + $tmp = @gzdecode($feed_data); + + if ($tmp) $feed_data = $tmp; + } + if ($debug_enabled) { _debug("update_rss_feed: fetch done."); } @@ -337,15 +343,15 @@ } } - $pluginhost = new PluginHost(Db::get()); + $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(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) { + foreach ($pluginhost->get_hooks(PluginHost::HOOK_FEED_FETCHED) as $plugin) { $feed_data = $plugin->hook_feed_fetched($feed_data); } @@ -382,7 +388,7 @@ } // We use local pluginhost here because we need to load different per-user feed plugins - $pluginhost->run_hooks($pluginhost::HOOK_FEED_PARSED, "hook_feed_parsed", $rss); + $pluginhost->run_hooks(PluginHost::HOOK_FEED_PARSED, "hook_feed_parsed", $rss); if ($debug_enabled) { _debug("update_rss_feed: processing feed data..."); @@ -667,7 +673,7 @@ "author" => $entry_author, "stored" => $stored_article); - foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_FILTER) as $plugin) { + foreach ($pluginhost->get_hooks(PluginHost::HOOK_ARTICLE_FILTER) as $plugin) { $article = $plugin->hook_article_filter($article); }