Add explicit support for `*` in excludedPackages
authorjoshuaruesweg <ruesweg@woltlab.com>
Mon, 6 Sep 2021 14:21:50 +0000 (16:21 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Mon, 6 Sep 2021 14:22:47 +0000 (16:22 +0200)
Closes #4149

wcfsetup/install/files/lib/system/package/PackageArchive.class.php

index 58a2fab20dd0b8de982cd1c648333f3a5b8151d5..ee96f8d74f5763e70538a292f1c4c8ca27d27cf9 100644 (file)
@@ -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']],
                             '<'