From: Andrew Dolgov Date: Wed, 30 Nov 2016 11:03:21 +0000 (+0300) Subject: rssfuncs: fix warning when trying to update nonexisting feed X-Git-Tag: 17.1~31 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bfe1eb4e52abf3bb4b457920d58aa671babb11e6;p=tt-rss.git rssfuncs: fix warning when trying to update nonexisting feed --- diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 25a24d19..3f4a0aef 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -311,6 +311,13 @@ $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 @@ -327,12 +334,6 @@ 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"));