瀏覽代碼

Handle array candidates in whatProvides

Nils Adermann 11 年之前
父節點
當前提交
aa74818fe0
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/Composer/DependencyResolver/Pool.php

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

@@ -268,7 +268,10 @@ class Pool
         $nameMatch = false;
 
         foreach ($candidates as $candidate) {
-            if ($this->whitelist !== null && !isset($this->whitelist[$candidate->getId()])) {
+            if ($this->whitelist !== null && (
+                (is_array($candidate) && isset($candidate['id']) && !isset($this->whitelist[$candidate['id']])) ||
+                (is_object($candidate) && !isset($this->whitelist[$candidate->getId()]))
+            )) {
                 continue;
             }
             switch ($this->match($candidate, $name, $constraint)) {