From 111b8dabef769faf4ed496acaa69d7e9da76c1e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 14 Apr 2022 12:23:15 +0200 Subject: [PATCH] Always check exclusions in PackageUpdateAction::createQueue() Ever since the method checked for package exclusions in 1d7f1d205ee64fd2723877c1f296c592518e516d it only applied the check to updates, not to fresh installs. It's not clear why it did so, I assume this to be an oversight. Change this to always run the exclusion check, otherwise exclusions might be circumvented using PackageUpdateAction::prepareInstallation() with a package+version combination that would regularly be excluded. --- .../update/PackageUpdateAction.class.php | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php index fb526a90a2..e80f1ddad7 100644 --- a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php @@ -757,19 +757,17 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction } // validate exclusions - if ($queueType == 'update') { - $excludedPackages = $scheduler->getExcludedPackages(); - - if (!empty($excludedPackages)) { - return [ - 'template' => WCF::getTPL()->fetch( - 'packageUpdateExcludedPackages', - 'wcf', - ['excludedPackages' => $excludedPackages] - ), - 'type' => 'conflict', - ]; - } + $excludedPackages = $scheduler->getExcludedPackages(); + + if (!empty($excludedPackages)) { + return [ + 'template' => WCF::getTPL()->fetch( + 'packageUpdateExcludedPackages', + 'wcf', + ['excludedPackages' => $excludedPackages] + ), + 'type' => 'conflict', + ]; } $stack = $scheduler->getPackageInstallationStack(); -- 2.20.1