$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->packageInfo['name']]);
while ($row = $statement->fetchArray()) {
- if (!empty($row['excludedPackageVersion'])) {
- if (Package::compareVersion($this->packageInfo['version'], $row['excludedPackageVersion'], '<')) {
- continue;
- }
+ if (
+ $row['excludedPackageVersion'] === '*'
+ || Package::compareVersion($this->packageInfo['version'], $row['excludedPackageVersion'], '>=')
+ ) {
+ $conflictedPackages[$row['packageID']] = new Package(null, $row);
}
-
- $conflictedPackages[$row['packageID']] = new Package(null, $row);
}
return $conflictedPackages;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
while ($row = $statement->fetchArray()) {
- if (!empty($excludedPackages[$row['package']])) {
- if (
- $excludedPackages[$row['package']] !== '*'
- && Package::compareVersion(
- $row['packageVersion'],
- $excludedPackages[$row['package']],
- '<'
- )
- ) {
- continue;
- }
+ if (
+ $excludedPackages[$row['package']] === '*'
+ || Package::compareVersion(
+ $row['packageVersion'],
+ $excludedPackages[$row['package']],
+ '>'
+ )
+ ) {
$row['excludedPackageVersion'] = $excludedPackages[$row['package']];
+ $conflictedPackages[$row['packageID']] = new Package(null, $row);
}
-
- $conflictedPackages[$row['packageID']] = new Package(null, $row);
}
}
$statement->execute([
$this->queue->packageID,
$excludedPackage['name'],
- !empty($excludedPackage['version']) ? $excludedPackage['version'] : '',
+ $excludedPackage['version'],
]);
}
}
];
// check version
- if (!empty($row['excludedPackageVersion'])) {
- if (Package::compareVersion($row['packageVersion'], $row['excludedPackageVersion'], '<')) {
- continue;
- }
+ if (
+ $row['excludedPackageVersion'] !== '*'
+ && Package::compareVersion($row['packageVersion'], $row['excludedPackageVersion'], '<')
+ ) {
+ continue;
}
$excludedPackages[] = [
if (!empty($row['excludedPackageVersion'])) {
// check version
if (
- Package::compareVersion(
+ $row['excludedPackageVersion'] !== "*"
+ && Package::compareVersion(
$packageInstallation['newVersion'],
$row['excludedPackageVersion'],
'<'
$excludedPackagesParameters[] = [
'packageUpdateVersionID' => $packageUpdateVersionID,
'excludedPackage' => $excludedIdentifier,
- 'excludedPackageVersion' => $exclusion['version'] ?? '',
+ 'excludedPackageVersion' => $exclusion['version'],
];
}
}
if (isset(self::$excludedPackages[$excludingPackage][$package])) {
for ($i = 0, $count = \count(self::$excludedPackages[$excludingPackage][$package]); $i < $count; $i++) {
if (
- Package::compareVersion(
+ self::$excludedPackages[$excludingPackage][$package][$i] === '*'
+ || Package::compareVersion(
$packageVersion,
self::$excludedPackages[$excludingPackage][$package][$i],
- '<'
+ '>='
)
) {
- continue;
+ $excludingPackages[] = new Package(null, $row);
}
-
- $excludingPackages[] = new Package(null, $row);
}
continue;
}
} else {
- if (Package::compareVersion($packageVersion, $row['excludedPackageVersion'], '<')) {
- continue;
+ if (
+ $row['excludedPackageVersion'] === '*'
+ || Package::compareVersion($packageVersion, $row['excludedPackageVersion'], '>=')
+ ) {
+ $excludingPackages[] = new Package(null, $row);
}
-
- $excludingPackages[] = new Package(null, $row);
}
}
for ($i = 0, $count = \count(self::$excludedPackages[$package][$excludedPackage]); $i < $count; $i++) {
if (
- Package::compareVersion(
+ self::$excludedPackages[$package][$excludedPackage][$i] !== "*"
+ && Package::compareVersion(
$version,
self::$excludedPackages[$package][$excludedPackage][$i],
'<'