From 0e9325da796a5a3b990a2d756ea5e5a2376841bd Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 12 Mar 2014 16:30:09 +0100 Subject: [PATCH] for AliasPackages check that the aliased package is white listed so that version constraints of AliasPackages are taken into account when computing package provisions --- src/Composer/DependencyResolver/Pool.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Composer/DependencyResolver/Pool.php b/src/Composer/DependencyResolver/Pool.php index 18f2d5797..853673905 100644 --- a/src/Composer/DependencyResolver/Pool.php +++ b/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; }