diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index 0932a5a43..e5a9b590e 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -224,9 +224,9 @@ class PluginManager } /** - * Verify that the provided plugin should be registered + * Prevent autoloaders from loading if plugin is disabled */ - if (!$plugin || $plugin->disabled || (self::$noInit && !$plugin->elevated)) { + if ($plugin->disabled) { return; } @@ -238,6 +238,13 @@ class PluginManager ComposerManager::instance()->autoload($pluginPath . '/vendor'); } + /** + * Disable plugin registration for restricted pages, unless elevated + */ + if (self::$noInit && !$plugin->elevated) { + return; + } + /** * Run the plugin's register() method */