]> git.wh0rd.org - tt-rss.git/commitdiff
ccache: possible workaround against misowned entries
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 1 Apr 2009 14:36:50 +0000 (18:36 +0400)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 1 Apr 2009 14:36:50 +0000 (18:36 +0400)
functions.php

index 9371596cc6d898d2a07796f3ca36348a78b0d248..e9ef17861b670927404bb54bb311d826117f3c05 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");
                } else {
                        $table = "ttrss_cat_counters_cache";
                }
 
                if (!is_numeric($feed_id)) return;
 
+               if (!$is_cat) {
+                       $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");
+               }
+
                $prev_unread = ccache_find($link, $feed_id, $owner_uid, $is_cat, true);
 
                /* When updating a label, all we need to do is recalculate feed counters