From b7c66f3d09683a5d5c99edeeb81be677fabfa1cc Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Mon, 6 Sep 2021 16:21:50 +0200 Subject: [PATCH] Add explicit support for `*` in excludedPackages Closes #4149 --- .../files/lib/system/package/PackageArchive.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php index 58a2fab20d..ee96f8d74f 100644 --- a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php @@ -329,7 +329,10 @@ class PackageArchive $data[$attribute->name] = $attribute->value; } - if (!isset($data['version']) || !Package::isValidVersion($data['version'])) { + if ( + !isset($data['version']) + || (!Package::isValidVersion($data['version']) && $data['version'] !== '*') + ) { throw new PackageValidationException( PackageValidationException::INVALID_EXCLUDED_PACKAGE_VERSION_NUBMER, [ @@ -969,7 +972,8 @@ class PackageArchive while ($row = $statement->fetchArray()) { if (!empty($excludedPackages[$row['package']])) { if ( - Package::compareVersion( + $excludedPackages[$row['package']] !== '*' + && Package::compareVersion( $row['packageVersion'], $excludedPackages[$row['package']], '<' -- 2.20.1