diff --git a/src/Composer/Command/RemoveCommand.php b/src/Composer/Command/RemoveCommand.php
index c85a4e593..6fd1d5d52 100644
--- a/src/Composer/Command/RemoveCommand.php
+++ b/src/Composer/Command/RemoveCommand.php
@@ -84,19 +84,19 @@ EOT
foreach (array('require', 'require-dev') as $linkType) {
if (isset($composer[$linkType])) {
foreach ($composer[$linkType] as $name => $version) {
- $composer[$linkType][strtolower($name)] = $version;
+ $composer[$linkType][strtolower($name)] = $name;
}
}
}
foreach ($packages as $package) {
if (isset($composer[$type][$package])) {
- $json->removeLink($type, $package);
+ $json->removeLink($type, $composer[$type][$package]);
} elseif (isset($composer[$altType][$package])) {
- $io->writeError(''.$package.' could not be found in '.$type.' but it is present in '.$altType.'');
+ $io->writeError(''.$composer[$altType][$package].' could not be found in '.$type.' but it is present in '.$altType.'');
if ($io->isInteractive()) {
if ($io->askConfirmation('Do you want to remove it from '.$altType.' [yes]? ', true)) {
- $json->removeLink($altType, $package);
+ $json->removeLink($altType, $composer[$altType][$package]);
}
}
} else {