浏览代码

Use -r option of read shell builtin to avoid escaping of backslashes on password input

Wes Mason 12 年之前
父节点
当前提交
169bb2d60e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/IO/ConsoleIO.php

+ 1 - 1
src/Composer/IO/ConsoleIO.php

@@ -173,7 +173,7 @@ class ConsoleIO implements IOInterface
             }
             if (isset($shell)) {
                 $this->write($question, false);
-                $readCmd = ($shell === 'csh') ? 'set mypassword = $<' : 'read mypassword';
+                $readCmd = ($shell === 'csh') ? 'set mypassword = $<' : 'read -r mypassword';
                 $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd);
                 $value = rtrim(shell_exec($command));
                 $this->write('');