From cfdbc2a8b2de4ae5b2d7a0691822d5f9abe8db3d Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 27 Jan 2024 00:46:34 +0100 Subject: [PATCH] Fixed: disabled plugins should not enable pages --- system/src/Plugins.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/system/src/Plugins.php b/system/src/Plugins.php index e8970d81..a310739d 100644 --- a/system/src/Plugins.php +++ b/system/src/Plugins.php @@ -22,16 +22,15 @@ class Plugins { } $routes = []; - - $pluginPages = glob(PLUGINS . '*/pages/*.php'); - foreach ($pluginPages as $file) { - $file = str_replace(PLUGINS, 'plugins/', $file); - $name = pathinfo($file, PATHINFO_FILENAME); - - $routes[] = [['get', 'post'], $name, $file, 1000]; - } - foreach(self::getAllPluginsJson() as $plugin) { + $pluginPages = glob(PLUGINS . $plugin['filename'] . '/pages/*.php'); + foreach ($pluginPages as $file) { + $file = str_replace(PLUGINS, 'plugins/', $file); + $name = pathinfo($file, PATHINFO_FILENAME); + + $routes[] = [['get', 'post'], $name, $file, 1000]; + } + $warningPreTitle = 'Plugin: ' . $plugin['name'] . ' - '; if (isset($plugin['routes'])) {