]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix cat filters always applying if set to uncategorized
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 29 Aug 2013 05:24:24 +0000 (09:24 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 29 Aug 2013 05:24:24 +0000 (09:24 +0400)
include/functions.php

index 9389e99f0a0f53f45e1fa8c194a46e86d9caf3e8..2d6716b8160768f6b296caf760638d556a6e3736 100644 (file)
 
                $cat_id = (int)getFeedCategory($feed_id);
 
+               if ($cat_id == 0)
+                       $null_cat_qpart = "cat_id IS NULL OR";
+               else
+                       $null_cat_qpart = "";
+
                $result = db_query("SELECT * FROM ttrss_filters2 WHERE
                        owner_uid = $owner_uid AND enabled = true ORDER BY order_id, title");
 
                                FROM ttrss_filters2_rules AS r,
                                ttrss_filter_types AS t
                                WHERE
-                                       (cat_id IS NULL OR cat_id IN ($check_cats)) AND
+                                       ($null_cat_qpart (cat_id IS NULL AND cat_filter = false) OR cat_id IN ($check_cats)) AND
                                        (feed_id IS NULL OR feed_id = '$feed_id') AND
                                        filter_type = t.id AND filter_id = '$filter_id'");