Incorrect usage of `array_filter`
authorAlexander Ebert <ebert@woltlab.com>
Tue, 24 Dec 2019 16:48:06 +0000 (17:48 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 24 Dec 2019 16:48:06 +0000 (17:48 +0100)
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php

index 1b9323280e65a305f63455febe421f54475d1d9c..8cb40824f2e11beae61687739e358ec88157c4e1 100644 (file)
@@ -568,14 +568,14 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                                        $excludeCore60 = '6.0.0 Alpha 1';
                                                        
                                                        $coreExclude = null;
-                                                       $versionData['excludedPackages'] = array_filter($versionData['excludedPackages'], function($excludedPackage) use (&$coreExclude) {
-                                                               if ($excludedPackage['excludedPackage'] === 'com.woltlab.wcf') {
-                                                                       $coreExclude = $excludedPackage['excludedPackageVersion'];
+                                                       $versionData['excludedPackages'] = array_filter($versionData['excludedPackages'], function($excludedPackage, $excludedVersion) use (&$coreExclude) {
+                                                               if ($excludedPackage === 'com.woltlab.wcf') {
+                                                                       $coreExclude = $excludedVersion;
                                                                        return false;
                                                                }
                                                                
                                                                return true;
-                                                       });
+                                                       }, ARRAY_FILTER_USE_BOTH);
                                                        
                                                        if ($coreExclude === null || Package::compareVersion($coreExclude, $excludeCore60, '>')) {
                                                                $versionData['excludedPackages'][] = [