1
0

Fixed PHP warning if JSON configuration is unreadable or empty. Fixes #3

This commit is contained in:
2013-04-13 01:16:53 +02:00
parent 5a5728ef4d
commit 8cd178076f
2 changed files with 6 additions and 1 deletions

View File

@ -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) {