From: Andrew Dolgov Date: Wed, 1 Apr 2009 14:36:50 +0000 (+0400) Subject: ccache: possible workaround against misowned entries X-Git-Tag: 1.3.3~21 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=2e93b64ccaf76c6bb605aad38a34d01a88656c18;p=tt-rss.git ccache: possible workaround against misowned entries --- diff --git a/functions.php b/functions.php index 9371596c..e9ef1786 100644 --- a/functions.php +++ b/functions.php @@ -5801,6 +5801,9 @@ 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"; } @@ -5832,6 +5835,12 @@ 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