From 3b1e1aeec0025cafdb16e8e1cb670cfd480389f9 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 10 Sep 2019 18:08:06 +0200 Subject: [PATCH] Fix writability check during WCF updates --- .../files/lib/acp/action/InstallPackageAction.class.php | 4 ++++ .../files/lib/system/cli/command/PackageCLICommand.class.php | 4 ++++ .../system/package/PackageInstallationDispatcher.class.php | 4 ---- .../system/package/PackageInstallationNodeBuilder.class.php | 4 ++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php index b8e6f50e2b..260b55fd4f 100755 --- a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php @@ -153,6 +153,10 @@ class InstallPackageAction extends AbstractDialogAction { // clean-up previously created nodes $this->installation->nodeBuilder->purgeNodes(); + if ($this->installation->getAction() === 'update' && $this->queue->package === 'com.woltlab.wcf') { + WCF::checkWritability(); + } + // create node tree $this->installation->nodeBuilder->buildNodes(); $nextNode = $this->installation->nodeBuilder->getNextNode(); diff --git a/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php b/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php index e5dafa1f4d..b705dfe488 100644 --- a/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php +++ b/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php @@ -313,6 +313,10 @@ class PackageCLICommand implements IArgumentedCLICommand { // clean-up previously created nodes $installation->nodeBuilder->purgeNodes(); + if ($package !== null && $package->package === 'com.woltlab.wcf') { + WCF::checkWritability(); + } + // create node tree $installation->nodeBuilder->buildNodes(); $node = $installation->nodeBuilder->getNextNode(); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 551219baae..54b55c1632 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -396,10 +396,6 @@ class PackageInstallationDispatcher { protected function installPackage(array $nodeData) { $installationStep = new PackageInstallationStep(); - if ($this->getAction() === 'update' && $this->getPackageName() === 'com.woltlab.wcf') { - WCF::checkWritability(); - } - // check requirements if (!empty($nodeData['requirements'])) { foreach ($nodeData['requirements'] as $package => $requirementData) { diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php index b21a3d6522..8ba9dfb159 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php @@ -509,6 +509,10 @@ class PackageInstallationNodeBuilder { } } + if ($archive->getPackageInfo('name') === 'com.woltlab.wcf') { + WCF::checkWritability(); + } + // create new queue $queue = PackageInstallationQueueEditor::create([ 'parentQueueID' => $queue->queueID, -- 2.20.1