]> git.wh0rd.org Git - tt-rss.git/commitdiff
rssfuncs: fix warning when trying to update nonexisting feed
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Wed, 30 Nov 2016 11:03:21 +0000 (14:03 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Wed, 30 Nov 2016 11:03:21 +0000 (14:03 +0300)
include/rssfuncs.php

index 25a24d19423180cf68cc32b66a1a46a1487fa0ea..3f4a0aef23ed3b912044563515abf4a79637df80 100644 (file)
 
                $result = db_query("SELECT title FROM ttrss_feeds
                        WHERE id = '$feed'");
+
+               if (db_num_rows($result) == 0) {
+                       _debug("feed $feed NOT FOUND/SKIPPED", $debug_enabled);
+                       user_error("Attempt to update unknown/invalid feed $feed", E_USER_WARNING);
+                       return false;
+               }
+
                $title = db_fetch_result($result, 0, "title");
 
                // feed was batch-subscribed or something, we need to get basic info
                        feed_language
                        FROM ttrss_feeds WHERE id = '$feed'");
 
-               if (db_num_rows($result) == 0) {
-                       _debug("feed $feed NOT FOUND/SKIPPED", $debug_enabled);
-                       user_error("Attempt to update unknown/invalid feed $feed", E_USER_WARNING);
-                       return false;
-               }
-
                $owner_uid = db_fetch_result($result, 0, "owner_uid");
                $mark_unread_on_update = sql_bool_to_bool(db_fetch_result($result,
                        0, "mark_unread_on_update"));