From fc2b721517646af2e4d901d95eeba802c1eb6a7d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 9 Mar 2021 10:41:33 +0100 Subject: [PATCH] Taint installed apps until the directory is selected The row in wcf1_application is created very early in the installation process, even before the application directory is selected. This causes it to contain bogus data. Now when pressing F5 during the folder section for whatever reason the application technically is installed, but it's not usable due to the missing XXXCore class. When the cache is being cleared this will brick the whole community. Taint apps until a proper application directory is selected. This reduces the time window for human error, because it's likely that the `file` PIP runs very soon after. --- .../package/PackageInstallationDispatcher.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index e2621d57c0..29ab84f96a 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -527,7 +527,8 @@ class PackageInstallationDispatcher { 'domainName' => $host, 'domainPath' => $path, 'cookieDomain' => $host, - 'packageID' => $package->packageID + 'packageID' => $package->packageID, + 'isTainted' => 1, ]); } } @@ -960,10 +961,13 @@ class PackageInstallationDispatcher { $domainPath = FileUtil::addLeadingSlash($domainPath); - // update application path + // update application path and untaint application $application = new Application($this->getPackage()->packageID); $applicationEditor = new ApplicationEditor($application); - $applicationEditor->update(['domainPath' => $domainPath]); + $applicationEditor->update([ + 'domainPath' => $domainPath, + 'isTainted' => 0, + ]); // create directory and set permissions @mkdir($packageDir, 0777, true); -- 2.20.1