From: Andrew Dolgov Date: Sun, 20 Nov 2005 10:25:50 +0000 (+0100) Subject: make update_rss_feed() neutral to logged in user X-Git-Tag: schema_feature_freeze_for_1.1~160 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7fed1940542e667d66e68e1b4568540ad26cbd12;p=tt-rss.git make update_rss_feed() neutral to logged in user --- diff --git a/functions.php b/functions.php index b6c426f5..e6b5b8e6 100644 --- a/functions.php +++ b/functions.php @@ -180,13 +180,15 @@ check_feed_favicon($feed_url, $feed, $link); } - $result = db_query($link, "SELECT title,icon_url,site_url + $result = db_query($link, "SELECT title,icon_url,site_url,owner_uid FROM ttrss_feeds WHERE id = '$feed'"); $registered_title = db_fetch_result($result, 0, "title"); $orig_icon_url = db_fetch_result($result, 0, "icon_url"); $orig_site_url = db_fetch_result($result, 0, "site_url"); + $owner_uid = db_fetch_result($result, 0, "owner_uid"); + if (!$registered_title) { $feed_title = db_escape_string($rss->channel["title"]); db_query($link, "UPDATE ttrss_feeds SET @@ -214,7 +216,7 @@ $result = db_query($link, "SELECT reg_exp, (SELECT name FROM ttrss_filter_types WHERE id = filter_type) as name - FROM ttrss_filters WHERE owner_uid = ".$_SESSION["uid"]); + FROM ttrss_filters WHERE owner_uid = $owner_uid"); while ($line = db_fetch_assoc($result)) { if (!$filters[$line["name"]]) $filters[$line["name"]] = array(); @@ -281,8 +283,6 @@ $result = db_query($link, "SELECT id FROM ttrss_entries WHERE guid = '$entry_guid'"); - $owner_uid = $_SESSION["uid"]; - $entry_content = db_escape_string($entry_content); $entry_title = db_escape_string($entry_title); $entry_link = db_escape_string($entry_link); @@ -411,7 +411,7 @@ FROM ttrss_entries,ttrss_user_entries WHERE guid = '$entry_guid' AND feed_id = '$feed' AND ref_id = id - AND owner_uid = " . $_SESSION["uid"]); + AND owner_uid = '$owner_uid'"); if (!$result || db_num_rows($result) != 1) { return; @@ -427,7 +427,7 @@ $result = db_query($link, "SELECT id FROM ttrss_tags WHERE tag_name = '$tag' AND post_int_id = '$entry_int_id' AND - owner_uid = ".$_SESSION["uid"]." LIMIT 1"); + owner_uid = '$owner_uid' LIMIT 1"); // print db_fetch_result($result, 0, "id"); @@ -437,7 +437,7 @@ db_query($link, "INSERT INTO ttrss_tags (owner_uid,tag_name,post_int_id) - VALUES ('".$_SESSION["uid"]."','$tag', '$entry_int_id')"); + VALUES ('$owner_uid','$tag', '$entry_int_id')"); } } }