]> git.wh0rd.org Git - tt-rss.git/commitdiff
first_id default value: type is important
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 12 Jul 2015 19:54:55 +0000 (22:54 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 12 Jul 2015 19:54:55 +0000 (22:54 +0300)
include/functions2.php

index 11274b713b900ef128d42ff1c9c6f476868f40c5..459a2a533b257261e7d1f3f0cc537c44f6d59ff5 100644 (file)
                                        $start_ts_query_part = "";
                                }
 
-                               $first_id = false;
+                               $first_id = 0;
                                // if previous topmost article id changed that means our current pagination is no longer valid
                                $query = "SELECT DISTINCT
                                                ttrss_feeds.title,
                                        }
 
                                        $result = db_query($query);
-                                       if ($result) {
+                                       if ($result && db_num_rows($result) > 0) {
                                                $first_id = (int) db_fetch_result($result, 0, "id");
 
-                                               if ($offset > 0 && $check_first_id && $first_id != $check_first_id) {
+                                               if ($offset > 0 && $first_id && $check_first_id && $first_id != $check_first_id) {
                                                        return array(-1, $feed_title, $feed_site_url, $last_error, $last_updated, $search_words, $first_id);
                                                }
                                        }