From 22cf7f5d4f67be49c1be351e2669123ffdcb30e1 Mon Sep 17 00:00:00 2001 From: slawkens1 Date: Wed, 11 Oct 2017 22:26:16 +0200 Subject: [PATCH] * more fixes to plugin dot --- system/pages/admin/plugins.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/system/pages/admin/plugins.php b/system/pages/admin/plugins.php index b5c48f72..16deb280 100644 --- a/system/pages/admin/plugins.php +++ b/system/pages/admin/plugins.php @@ -229,11 +229,13 @@ $rows = array(); $path = PLUGINS; foreach(scandir($path) as $file) { - $file_info = explode('.', $file); - if($file == '.' || $file == '..' || $file == 'disabled' || $file == 'example.json' || is_dir($path . $file) || !$file_info[1] || $file_info[1] != 'json') + $file_ext = pathinfo($file, PATHINFO_EXTENSION); + $file_name = pathinfo($file, PATHINFO_FILENAME); + if($file == '.' || $file == '..' || $file == 'disabled' || $file == 'example.json' || is_dir($path . $file) || $file_ext != 'json') continue; - $string = file_get_contents(BASE . 'plugins/' . $file_info[0] . '.json'); + $file_info = str_replace('.json', '', $file_name); + $string = file_get_contents(BASE . 'plugins/' . $file_info . '.json'); $plugin_info = json_decode($string, true); if($plugin_info == false) { warning('Cannot load plugin info ' . $file); @@ -245,7 +247,7 @@ foreach(scandir($path) as $file) 'version' => $plugin_info['version'], 'author' => $plugin_info['author'], 'contact' => $plugin_info['contact'], - 'file' => $file_info[0], + 'file' => $file_info, 'uninstall' => isset($plugin_info['uninstall']) ); }