diff options
author | Troy Engel <[email protected]> | 2015-12-05 14:49:54 -0600 |
---|---|---|
committer | Troy Engel <[email protected]> | 2015-12-05 14:49:54 -0600 |
commit | 3e220fd13165eff5d2c3180f2a2c82672a3187a6 (patch) | |
tree | ebdf54b794cd6d8db0a42877a1872e5b841ca3ac /plugins/af_readability | |
parent | beaddcba961cd187e6d3ce968b94610838d70b54 (diff) |
Revert "Fix accidental use of emtpy array: [E_WARNING (2) plugins/af_readability/init.php:186 Invalid argument supplied for foreach()]"
This reverts commit beaddcba961cd187e6d3ce968b94610838d70b54.
Diffstat (limited to 'plugins/af_readability')
-rwxr-xr-x | plugins/af_readability/init.php | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/plugins/af_readability/init.php b/plugins/af_readability/init.php index 97acb4375..675e5c5d5 100755 --- a/plugins/af_readability/init.php +++ b/plugins/af_readability/init.php @@ -33,11 +33,9 @@ class Af_Readability extends Plugin { print_notice("Enable the plugin for specific feeds in the feed editor."); $enabled_feeds = $this->host->get($this, "enabled_feeds"); - if (!array($enabled_feeds)) { - $enabled_feeds = array(); - } else { - $enabled_feeds = $this->filter_unknown_feeds($enabled_feeds); - } + if (!array($enabled_feeds)) $enabled_feeds = array(); + + $enabled_feeds = $this->filter_unknown_feeds($enabled_feeds); $this->host->set($this, "enabled_feeds", $enabled_feeds); if (count($enabled_feeds) > 0) { @@ -185,14 +183,12 @@ class Af_Readability extends Plugin { private function filter_unknown_feeds($enabled_feeds) { $tmp = array(); - if (!empty($enabled_feeds)) { - foreach ($enabled_feeds as $feed) { + foreach ($enabled_feeds as $feed) { - $result = db_query("SELECT id FROM ttrss_feeds WHERE id = '$feed' AND owner_uid = " . $_SESSION["uid"]); + $result = db_query("SELECT id FROM ttrss_feeds WHERE id = '$feed' AND owner_uid = " . $_SESSION["uid"]); - if (db_num_rows($result) != 0) { - array_push($tmp, $feed); - } + if (db_num_rows($result) != 0) { + array_push($tmp, $feed); } } |