";
+ $tmp_content .= "";
- print "";
-
print "
- ";
+ ";
if (!(defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER)) {
print "";
@@ -1076,6 +1037,8 @@ class Feeds extends Handler_Protected {
print "
";
+ print "";
+
//return;
}
@@ -1133,6 +1096,8 @@ class Feeds extends Handler_Protected {
$active_feed_id = sprintf("%d", $this->params[0]);
$is_cat = $this->params[1] != "false";
+ print "";
}
function update_debugger() {
@@ -1263,6 +1230,7 @@ class Feeds extends Handler_Protected {
if ($feed > 0) {
$children = Feeds::getChildCategories($feed, $owner_uid);
array_push($children, $feed);
+ $children = array_map("intval", $children);
$children = join(",", $children);
@@ -1429,7 +1397,7 @@ class Feeds extends Handler_Protected {
} else if ($n_feed >= 0) {
if ($n_feed != 0) {
- $match_part = "feed_id = '$n_feed'";
+ $match_part = "feed_id = " . (int)$n_feed;
} else {
$match_part = "feed_id IS NULL";
}
@@ -1500,6 +1468,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)";
@@ -1508,10 +1480,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);
@@ -1538,7 +1506,7 @@ class Feeds extends Handler_Protected {
(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)
VALUES (?, ?, ?, ?, ?, ?, 0, false)");
- $sth->execute([$_SESSION['uid'], $url, "[Unknown]", $cat_id, $auth_login, $auth_pass]);
+ $sth->execute([$_SESSION['uid'], $url, "[Unknown]", $cat_id, (string)$auth_login, (string)$auth_pass]);
$sth = $pdo->prepare("SELECT id FROM ttrss_feeds WHERE feed_url = ?
AND owner_uid = ?");
@@ -1664,7 +1632,7 @@ class Feeds extends Handler_Protected {
$cat_feeds = array();
while ($line = $sth->fetch()) {
- array_push($cat_feeds, "feed_id = " . $line["id"]);
+ array_push($cat_feeds, "feed_id = " . (int)$line["id"]);
}
if (count($cat_feeds) == 0) return 0;
@@ -1879,8 +1847,9 @@ class Feeds extends Handler_Protected {
if ($include_children) {
# sub-cats
$subcats = Feeds::getChildCategories($feed, $owner_uid);
-
array_push($subcats, $feed);
+ $subcats = array_map("intval", $subcats);
+
$query_strategy_part = "cat_id IN (".
implode(",", $subcats).")";
@@ -2088,9 +2057,9 @@ class Feeds extends Handler_Protected {
$sanity_interval_qpart
$first_id_query_strategy_part ORDER BY $order_by LIMIT 1";
- if ($_REQUEST["debug"]) {
+ /*if ($_REQUEST["debug"]) {
print $query;
- }
+ }*/
$res = $pdo->query($query);
@@ -2136,7 +2105,7 @@ class Feeds extends Handler_Protected {
$query_strategy_part ORDER BY $order_by
$limit_query_part $offset_query_part";
- if ($_REQUEST["debug"]) print $query;
+ //if ($_REQUEST["debug"]) print $query;
$res = $pdo->query($query);