From bb5ec8cfb89bc5cc1532ffacee22e21aa9415e23 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 1 Jul 2016 02:16:23 -0700 Subject: allow multiple apd's per plugin dir --- Zotlabs/Lib/Apps.php | 5 +++-- Zotlabs/Module/Import_items.php | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 20556212a..19ed1b612 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -33,8 +33,9 @@ class Apps { $files = glob('addon/*/*.apd'); if($files) { foreach($files as $f) { - $n = basename($f,'.apd'); - if(plugin_is_installed($n)) { + $path = explode('/',$f); + $plugin = $path[1]; + if(plugin_is_installed($plugin)) { $x = self::parse_app_description($f,$translate); if($x) { $ret[] = $x; diff --git a/Zotlabs/Module/Import_items.php b/Zotlabs/Module/Import_items.php index 07b1c620c..f20cbfe7e 100644 --- a/Zotlabs/Module/Import_items.php +++ b/Zotlabs/Module/Import_items.php @@ -78,6 +78,8 @@ class Import_items extends \Zotlabs\Web\Controller { // logger('import: data: ' . print_r($data,true)); // print_r($data); + if(! is_array($data)) + return; if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) { $v1 = substr($data['compatibility']['database'],-4); -- cgit v1.2.3