]> git.wh0rd.org Git - tt-rss.git/commitdiff
ccache: do not override owner_uid fetching for virtual feeds
authorAndrew Dolgov <fox@bah.org.ru>
Thu, 2 Apr 2009 07:25:23 +0000 (11:25 +0400)
committerAndrew Dolgov <fox@bah.org.ru>
Thu, 2 Apr 2009 07:25:23 +0000 (11:25 +0400)
functions.php

index e9ef17861b670927404bb54bb311d826117f3c05..8d69cc0b96ab43fedde3a6dbe2822eb95850a1fb 100644 (file)
 
                if (!$is_cat) {
                        $table = "ttrss_counters_cache";
-                       $tmp_result = db_query($link, "SELECT owner_uid FROM ttrss_feeds 
-                               WHERE id = '$feed_id'");
-                       $owner_uid = db_fetch_result($tmp_result, 0, "owner_uid");
+                       if ($feed_id > 0) {
+                               $tmp_result = db_query($link, "SELECT owner_uid FROM ttrss_feeds 
+                                       WHERE id = '$feed_id'");
+                               $owner_uid = db_fetch_result($tmp_result, 0, "owner_uid");
+                       }
                } else {
                        $table = "ttrss_cat_counters_cache";
                }
 
                if (!is_numeric($feed_id)) return;
 
-               if (!$is_cat) {
+               if (!$is_cat && $feed_id > 0) {
                        $tmp_result = db_query($link, "SELECT owner_uid FROM ttrss_feeds 
                                WHERE id = '$feed_id'");
                        $owner_uid = db_fetch_result($tmp_result, 0, "owner_uid");