]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix php warning while testing filters with regexps too complex for the database
authorAndrew Dolgov <fox@fakecake.org>
Wed, 20 Feb 2013 05:34:00 +0000 (09:34 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Wed, 20 Feb 2013 05:34:00 +0000 (09:34 +0400)
include/functions.php

index 7409ec76a688fa0d910932ea1a1d6a38d5f869cb..37cfd48449b305a5c03f40ce518e8da11acdfa7d 100644 (file)
                                        ttrss_user_entries, ttrss_feeds, ttrss_feed_categories
                                        WHERE $filter_query_part LIMIT 1", false);
 
-                               $test = db_fetch_result($result, 0, "true_val");
+                               if ($result) {
+                                       $test = db_fetch_result($result, 0, "true_val");
 
-                               if (!$test) {
-                                       $filter_query_part = "false AND";
+                                       if (!$test) {
+                                               $filter_query_part = "false AND";
+                                       } else {
+                                               $filter_query_part .= " AND";
+                                       }
                                } else {
-                                       $filter_query_part .= " AND";
+                                       $filter_query_part = "false AND";
                                }
 
                        } else {