From d4673b8d7754c60d0f782dcbc2349ee41601922b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 18 Nov 2022 10:21:42 +0100 Subject: [PATCH] Take a package version instead of a package in PackageArchive::getUpdateInstructionsFor() --- .../files/lib/system/package/PackageArchive.class.php | 6 +++--- .../package/validation/PackageValidationArchive.class.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php index 94de5d8512..422ee208e2 100644 --- a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php @@ -599,15 +599,15 @@ class PackageArchive } /** - * Returns the appropriate update instructions to update the given package, + * Returns the appropriate update instructions to update the given package version, * `null` if no appropriate instruction could be found. * * @since 6.0 */ - public function getUpdateInstructionsFor(Package $package): ?array + public function getUpdateInstructionsFor(string $version): ?array { foreach ($this->instructions['update'] as $fromVersion => $instructions) { - if (Package::checkFromversion($package->packageVersion, $fromVersion)) { + if (Package::checkFromversion($version, $fromVersion)) { return $instructions; } } diff --git a/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php b/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php index 06855c0d40..88556b49ee 100644 --- a/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php @@ -233,7 +233,7 @@ final class PackageValidationArchive implements \RecursiveIterator } } else { // package is already installed, check update path - $instructions = $this->archive->getUpdateInstructionsFor($package); + $instructions = $this->archive->getUpdateInstructionsFor($package->packageVersion); if ($instructions === null) { $deliveredPackageVersion = $this->archive->getPackageInfo('version'); -- 2.20.1