extend parse debugging, fix syndicated feed format

master
Andrew Dolgov 18 years ago
parent 237ec2ad9c
commit 4bc6480705

@ -379,7 +379,7 @@
return; return;
} }
if (defined('DAEMON_EXTENDED_DEBUG')) { if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) {
_debug("update_rss_feed: start"); _debug("update_rss_feed: start");
} }
@ -407,7 +407,7 @@
} }
if (defined('DAEMON_EXTENDED_DEBUG')) { if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) {
_debug("update_rss_feed: fetching..."); _debug("update_rss_feed: fetching...");
} }
@ -417,7 +417,7 @@
$rss = fetch_rss($fetch_url); $rss = fetch_rss($fetch_url);
if (defined('DAEMON_EXTENDED_DEBUG')) { if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) {
_debug("update_rss_feed: fetch done, parsing..."); _debug("update_rss_feed: fetch done, parsing...");
} else { } else {
error_reporting (DEFAULT_ERROR_LEVEL); error_reporting (DEFAULT_ERROR_LEVEL);
@ -427,7 +427,7 @@
if ($rss) { if ($rss) {
if (defined('DAEMON_EXTENDED_DEBUG')) { if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) {
_debug("update_rss_feed: processing feed data..."); _debug("update_rss_feed: processing feed data...");
} }
@ -443,7 +443,7 @@
$owner_uid = db_fetch_result($result, 0, "owner_uid"); $owner_uid = db_fetch_result($result, 0, "owner_uid");
if (get_pref($link, 'ENABLE_FEED_ICONS', $owner_uid, false)) { if (get_pref($link, 'ENABLE_FEED_ICONS', $owner_uid, false)) {
if (defined('DAEMON_EXTENDED_DEBUG')) { if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) {
_debug("update_rss_feed: checking favicon..."); _debug("update_rss_feed: checking favicon...");
} }
check_feed_favicon($rss->channel["link"], $feed, $link); check_feed_favicon($rss->channel["link"], $feed, $link);
@ -453,6 +453,10 @@
$feed_title = db_escape_string($rss->channel["title"]); $feed_title = db_escape_string($rss->channel["title"]);
if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) {
_debug("update_rss_feed: registering title: $feed_title");
}
db_query($link, "UPDATE ttrss_feeds SET db_query($link, "UPDATE ttrss_feeds SET
title = '$feed_title' WHERE id = '$feed'"); title = '$feed_title' WHERE id = '$feed'");
} }
@ -475,7 +479,7 @@
db_query($link, "UPDATE ttrss_feeds SET icon_url = '$icon_url' WHERE id = '$feed'"); db_query($link, "UPDATE ttrss_feeds SET icon_url = '$icon_url' WHERE id = '$feed'");
} }
if (defined('DAEMON_EXTENDED_DEBUG')) { if (defined('DAEMON_EXTENDED_DEBUG' || $_GET['xdebug'])) {
_debug("update_rss_feed: loading filters..."); _debug("update_rss_feed: loading filters...");
} }
@ -1192,6 +1196,8 @@
function http_authenticate_user($link) { function http_authenticate_user($link) {
error_log("http_authenticate_user: ".$_SERVER["PHP_AUTH_USER"]."\n", 3, '/tmp/tt-rss.log');
if (!$_SERVER["PHP_AUTH_USER"]) { if (!$_SERVER["PHP_AUTH_USER"]) {
header('WWW-Authenticate: Basic realm="Tiny Tiny RSS RSSGen"'); header('WWW-Authenticate: Basic realm="Tiny Tiny RSS RSSGen"');
@ -2676,15 +2682,17 @@
$feed_site_url = $qfh_ret[2]; $feed_site_url = $qfh_ret[2];
$last_error = $qfh_ret[3]; $last_error = $qfh_ret[3];
# if (!$feed_site_url) $feed_site_url = "http://localhost/";
print "<rss version=\"2.0\"> print "<rss version=\"2.0\">
<channel> <channel>
<title>$feed_title</title> <title>$feed_title</title>
<link>$feed_site_url</link> <link>$feed_site_url</link>
<generator>Tiny Tiny RSS v".VERSION."</generator>"; <description>Feed generated by Tiny Tiny RSS</description>";
while ($line = db_fetch_assoc($result)) { while ($line = db_fetch_assoc($result)) {
print "<item>"; print "<item>";
print "<id>" . htmlspecialchars($line["guid"]) . "</id>"; print "<guid>" . htmlspecialchars($line["guid"]) . "</guid>";
print "<link>" . htmlspecialchars($line["link"]) . "</link>"; print "<link>" . htmlspecialchars($line["link"]) . "</link>";
$tags = get_article_tags($link, $line["id"]); $tags = get_article_tags($link, $line["id"]);

Loading…
Cancel
Save