]> git.wh0rd.org Git - tt-rss.git/commitdiff
getLabelCounters: properly check for user_entry uid (closes #671)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 7 Apr 2013 04:43:51 +0000 (08:43 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 7 Apr 2013 04:43:51 +0000 (08:43 +0400)
include/functions.php

index 0469c512d99baaa9f6dee0157cc0bf4f49210a5d..f2d25db0775cb6e3e9c82b0e1142299818c58d02 100644 (file)
 
                global $fetch_last_error;
                global $fetch_last_error_code;
-               
+
                $url = str_replace(' ', '%20', $url);
 
                if (!defined('NO_CURL') && function_exists('curl_init') && !ini_get("open_basedir")) {
                $result = db_query($link, "SELECT id,caption,COUNT(unread) AS unread
                        FROM ttrss_labels2 LEFT JOIN ttrss_user_labels2 ON
                                (ttrss_labels2.id = label_id)
-                                       LEFT JOIN ttrss_user_entries ON (ref_id = article_id AND unread = true)
+                               LEFT JOIN ttrss_user_entries ON (ref_id = article_id AND unread = true
+                                       AND ttrss_user_entries.owner_uid = $owner_uid)
                                WHERE ttrss_labels2.owner_uid = $owner_uid GROUP BY ttrss_labels2.id,
                                        ttrss_labels2.caption");