Explorar o código

Merge pull request #2569 from gimler/patch-1

Escape env value before passing it to system call
Jordi Boggiano %!s(int64=11) %!d(string=hai) anos
pai
achega
42c496752a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Composer/Command/ConfigCommand.php

+ 1 - 1
src/Composer/Command/ConfigCommand.php

@@ -132,7 +132,7 @@ EOT
     {
         // Open file in editor
         if ($input->getOption('editor')) {
-            $editor = getenv('EDITOR');
+            $editor = escapeshellcmd(getenv('EDITOR'));
             if (!$editor) {
                 if (defined('PHP_WINDOWS_VERSION_BUILD')) {
                     $editor = 'notepad';