Quellcode durchsuchen

for AliasPackages check that the aliased package is white listed so that version constraints of AliasPackages are taken into account when computing package provisions

Christian Flothmann vor 11 Jahren
Ursprung
Commit
0e9325da79
1 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
  1. 10 1
      src/Composer/DependencyResolver/Pool.php

+ 10 - 1
src/Composer/DependencyResolver/Pool.php

@@ -268,9 +268,18 @@ class Pool
         $nameMatch = false;
 
         foreach ($candidates as $candidate) {
+            $aliasOfCandidate = null;
+
+            // alias packages are not white listed, make sure that the package
+            // being aliased is white listed
+            if ($candidate instanceof AliasPackage) {
+                $aliasOfCandidate = $candidate->getAliasOf();
+            }
+
             if ($this->whitelist !== null && (
                 (is_array($candidate) && isset($candidate['id']) && !isset($this->whitelist[$candidate['id']])) ||
-                (is_object($candidate) && !isset($this->whitelist[$candidate->getId()]))
+                (is_object($candidate) && !($candidate instanceof AliasPackage) && !isset($this->whitelist[$candidate->getId()])) ||
+                (is_object($candidate) && $candidate instanceof AliasPackage && !isset($this->whitelist[$aliasOfCandidate->getId()]))
             )) {
                 continue;
             }