Skip to content

Commit

Permalink
Fixed: disabled plugins should not enable pages
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Jan 26, 2024
1 parent 1a6fb8b commit cfdbc2a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions system/src/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ public static function getRoutes()
}

$routes = [];
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);

$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];
}
$routes[] = [['get', 'post'], $name, $file, 1000];
}

foreach(self::getAllPluginsJson() as $plugin) {
$warningPreTitle = 'Plugin: ' . $plugin['name'] . ' - ';

if (isset($plugin['routes'])) {
Expand Down

0 comments on commit cfdbc2a

Please sign in to comment.