X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=classes%2Ffeeds.php;h=09bfdea7257fcdd4df4262424b9af0fceb82e020;hb=50052fb78a3a9d1bb3fa488e7fd7b23125c38124;hp=015418328729ccb3cc7849be80c99f399533e338;hpb=c30f5e18119d1935e8fe6d422053b127e8f4f1b3;p=tt-rss.git diff --git a/classes/feeds.php b/classes/feeds.php index 01541832..09bfdea7 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -173,7 +173,7 @@ class Feeds extends Handler_Protected { $method_split = explode(":", $method); if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) { - $sth = $this->pdo->prepare("UPDATE ttrss_feeds + $sth = $this->pdo->prepare("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01' WHERE id = ?"); $sth->execute([$feed]); @@ -277,7 +277,6 @@ class Feeds extends Handler_Protected { $lnum = $offset; $num_unread = 0; if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info); - $expand_cdm = get_pref('CDM_EXPANDED'); if (is_object($result)) { @@ -363,9 +362,7 @@ class Feeds extends Handler_Protected { $entry_author = " — $entry_author"; } - $has_feed_icon = feeds::feedHasIcon($feed_id); - - if ($has_feed_icon) { + if (feeds::feedHasIcon($feed_id)) { $feed_icon_img = "\"\""; } else { $feed_icon_img = "\"\""; @@ -393,7 +390,7 @@ class Feeds extends Handler_Protected { $vf_catchup_link = "".__('mark feed as read').""; - $reply['content'] .= "
". + $reply['content'] .= "
". "
$feed_icon_img
". "". $line["feed_title"]." @@ -418,7 +415,7 @@ class Feeds extends Handler_Protected { $reply['content'] .= "
"; - $reply['content'] .= "" . truncate_string($line["title"], 200); @@ -477,6 +474,8 @@ class Feeds extends Handler_Protected { $line = $p->hook_render_article_cdm($line); } + $line['content'] = rewrite_cached_urls($line['content']); + if ($vfeed_group_enabled && $line["feed_title"]) { if ($feed_id != $vgroup_last_feed) { @@ -487,7 +486,7 @@ class Feeds extends Handler_Protected { $feed_icon_src = Feeds::getFeedIcon($feed_id); $feed_icon_img = ""; - $reply['content'] .= "
". + $reply['content'] .= ""; @@ -495,10 +494,10 @@ class Feeds extends Handler_Protected { } } - $expanded_class = $expand_cdm ? "expanded" : "expandable"; + $content_encoded = htmlspecialchars($line["content"]); - $tmp_content = "
"; + $tmp_content = "
"; $tmp_content .= "
"; $tmp_content .= ""; //cdmHeader - $tmp_content .= "
"; + $tmp_content .= "
"; $tmp_content .= "
"; if ($line['note']) { @@ -586,6 +572,7 @@ class Feeds extends Handler_Protected { if (!$line['lang']) $line['lang'] = 'en'; + // this is filled from RROW data-content $tmp_content .= "
"; if ($line["orig_feed_id"]) { @@ -614,14 +601,7 @@ class Feeds extends Handler_Protected { } } - $tmp_content .= ""; - $tmp_content .= ""; - $tmp_content .= htmlspecialchars($line["content"]); - $tmp_content .= ""; - $tmp_content .= ""; - $tmp_content .= "
"; //cdmContentInner - $tmp_content .= "
"; $always_display_enclosures = $line["always_display_enclosures"]; @@ -630,7 +610,7 @@ class Feeds extends Handler_Protected { $tmp_content .= "
"; // cdmIntermediate - $tmp_content .= "
"; + $tmp_content .= "
"; foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) { $tmp_content .= $p->hook_article_left_button($line); @@ -1132,6 +1112,9 @@ class Feeds extends Handler_Protected { function update_debugger() { header("Content-type: text/html"); + Debug::set_enabled(true); + Debug::set_loglevel($_REQUEST["xdebug"]); + $feed_id = (int)$_REQUEST["feed_id"]; @$do_update = $_REQUEST["action"] == "do_update"; $csrf_token = $_REQUEST["csrf_token"]; @@ -1466,6 +1449,10 @@ class Feeds extends Handler_Protected { $contents = @fetch_file_contents($url, false, $auth_login, $auth_pass); + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) { + $contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass); + } + if (!$contents) { if (preg_match("/cloudflare\.com/", $fetch_last_error_content)) { $fetch_last_error .= " (feed behind Cloudflare)"; @@ -1474,10 +1461,6 @@ class Feeds extends Handler_Protected { return array("code" => 5, "message" => $fetch_last_error); } - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) { - $contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass); - } - if (is_html($contents)) { $feedUrls = get_feeds_from_html($url, $contents);