diff options
| author | Markus Birth <markus@birth-online.de> | 2013-04-13 01:16:53 +0200 |
|---|---|---|
| committer | Markus Birth <markus@birth-online.de> | 2013-04-13 01:16:53 +0200 |
| commit | 8cd178076ff7ff3f8973b7119a2675a3ec133faa (patch) | |
| tree | 9ca14bad7d1fa2b027869e3f8e5a6ecf8ed6e0be /init.php | |
| parent | 5a5728ef4d0b0291b039cf1942e87cc8d621d00b (diff) | |
| download | yafpp-8cd178076ff7ff3f8973b7119a2675a3ec133faa.tar.gz yafpp-8cd178076ff7ff3f8973b7119a2675a3ec133faa.zip | |
Fixed PHP warning if JSON configuration is unreadable or empty. Fixes #3
Diffstat (limited to 'init.php')
| -rw-r--r-- | init.php | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -52,6 +52,11 @@ class Af_Feedmod extends Plugin implements IHandler $owner_uid = $article['owner_uid']; $data = json_decode($json_conf, true); + if (!is_array($data)) { + // no valid JSON or no configuration at all + return $article; + } + foreach ($data as $urlpart=>$config) { if (strpos($article['link'], $urlpart) === false) continue; // skip this config if URL not matching if (strpos($article['plugin_data'], "feedmod,$owner_uid:") !== false) { |
