1
0
Fork 0

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

pull/1238/merge
Wes Mason 2012-10-19 23:21:13 +01:00 committed by Jordi Boggiano
parent 31a1bd2c39
commit 169bb2d60e
1 changed files with 1 additions and 1 deletions

View File

@ -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('');