From 8323e85bc844466fc71a85782bbd0f6141aa2750 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 12 Jul 2022 13:24:21 +0200 Subject: [PATCH] Fix allow-plugins check to not check plugins which are anyway incompatible with the current Composer version, refs #10928 --- src/Composer/Plugin/PluginManager.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Composer/Plugin/PluginManager.php b/src/Composer/Plugin/PluginManager.php index 1210dd189..c3647438c 100644 --- a/src/Composer/Plugin/PluginManager.php +++ b/src/Composer/Plugin/PluginManager.php @@ -165,11 +165,6 @@ class PluginManager return; } - if (!$this->isPluginAllowed($package->getName(), $isGlobalPlugin)) { - $this->io->writeError('Skipped loading "'.$package->getName() . '" '.($isGlobalPlugin ? '(installed globally) ' : '').'as it is not in config.allow-plugins', true, IOInterface::DEBUG); - return; - } - if ($package->getType() === 'composer-plugin') { $requiresComposer = null; foreach ($package->getRequires() as $link) { /** @var Link $link */ @@ -201,6 +196,12 @@ class PluginManager } } + if (!$this->isPluginAllowed($package->getName(), $isGlobalPlugin)) { + $this->io->writeError('Skipped loading "'.$package->getName() . '" '.($isGlobalPlugin ? '(installed globally) ' : '').'as it is not in config.allow-plugins', true, IOInterface::DEBUG); + + return; + } + $oldInstallerPlugin = ($package->getType() === 'composer-installer'); if (isset($this->registeredPlugins[$package->getName()])) {