]> git.wh0rd.org Git - tt-rss.git/commitdiff
minor filter test dialog fixes
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 13 Jul 2015 09:53:13 +0000 (12:53 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 13 Jul 2015 09:53:13 +0000 (12:53 +0300)
classes/pref/filters.php

index de86d8d606d51466e15713c5ae1d2581b5873804..2c039e5df455be27295809796ab08d28ae438010 100644 (file)
@@ -78,12 +78,12 @@ class Pref_Filters extends Handler_Protected {
                                        unset($rule["feed_id"]);
                                }
 
-                               if (isset($rule["feed_id"])) {
+                               if (isset($rule["feed_id"]) && $rule['feed_id'] > 0) {
                                        array_push($scope_qparts, "feed_id = " . $rule["feed_id"]);
                                }
 
                                if (isset($rule["cat_id"])) {
-                                       array_push($scope_qparts, "cat_id = " . $rule["feed_id"]);
+                                       array_push($scope_qparts, "cat_id = " . $rule["cat_id"]);
                                }
 
                                array_push($filter["rules"], $rule);
@@ -109,6 +109,8 @@ class Pref_Filters extends Handler_Protected {
                $glue = $filter['match_any_rule'] ? " AND " :  "OR ";
                $scope_qpart = join($glue, $scope_qparts);
 
+               if (!$scope_qpart) $scope_qpart = "true";
+
                while ($found < $limit && $offset < $limit * 10 && time() - $started < ini_get("max_execution_time") * 0.7) {
 
                        $result = db_query("SELECT ttrss_entries.id,