From c36a9350bd6e81ca3ba3bbb49c72d6860489c393 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 27 Apr 2022 21:10:06 +0200 Subject: [PATCH] Fix TypeError in ConfigCommand (#10753) * Fix TypeError in ConfigCommand * Update ConfigCommand.php --- src/Composer/Command/ConfigCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 56ccb5b5e..cf3bd4298 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -214,7 +214,7 @@ EOT { // Open file in editor if (true === $input->getOption('editor')) { - $editor = escapeshellcmd(Platform::getEnv('EDITOR')); + $editor = Platform::getEnv('EDITOR'); if (!$editor) { if (Platform::isWindows()) { $editor = 'notepad'; @@ -226,6 +226,8 @@ EOT } } } + } else { + $editor = escapeshellcmd($editor); } $file = $input->getOption('auth') ? $this->authConfigFile->getPath() : $this->configFile->getPath();