Эх сурвалжийг харах

Escape env value before passing it to system call

Gordon Franke 11 жил өмнө
parent
commit
202701c391

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

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