diff options
author | Andrew Dolgov <[email protected]> | 2015-12-06 00:22:29 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-12-06 00:22:29 +0300 |
commit | c4d0e0806022c7d1ebef44d70bfe9332d6ab756e (patch) | |
tree | 73c5b32b9e491e69543830d8cad27eda1af1001e /plugins | |
parent | f61f2a2699b01eaf80eb3dbe4ba21c496364498b (diff) | |
parent | 5d5f100f4f781f744ccf769ed3790680e76a0ff1 (diff) |
Merge branch 'af-readability' into 'master'
Fix array checking method in 2 places, add array check in one location for af_readability
See: https://tt-rss.org/gitlab/fox/tt-rss/merge_requests/19
Update method of array checking to is_array() in 2 locations, add the same check in another location that could have compared a NULL.
See merge request !20
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/af_readability/init.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/af_readability/init.php b/plugins/af_readability/init.php index 675e5c5d5..1d7c638a6 100755 --- a/plugins/af_readability/init.php +++ b/plugins/af_readability/init.php @@ -33,7 +33,7 @@ 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(); + if (!is_array($enabled_feeds)) $enabled_feeds = array(); $enabled_feeds = $this->filter_unknown_feeds($enabled_feeds); $this->host->set($this, "enabled_feeds", $enabled_feeds); @@ -60,7 +60,7 @@ class Af_Readability extends Plugin { print "<div class=\"dlgSecCont\">"; $enabled_feeds = $this->host->get($this, "enabled_feeds"); - if (!array($enabled_feeds)) $enabled_feeds = array(); + if (!is_array($enabled_feeds)) $enabled_feeds = array(); $key = array_search($feed_id, $enabled_feeds); $checked = $key !== FALSE ? "checked" : ""; @@ -169,6 +169,8 @@ class Af_Readability extends Plugin { function hook_article_filter($article) { $enabled_feeds = $this->host->get($this, "enabled_feeds"); + if (!is_array($enabled_feeds)) return $article; + $key = array_search($article["feed"]["id"], $enabled_feeds); if ($key === FALSE) return $article; |