You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Command is executed: echo " foo|bar " 2>&1 There are two unwanted spaces in argument.
Root cause
Argument is escaped twice. Look at row 229 in file ExecTask.php: $this->realCommand = Commandline::toString($this->commandline->getCommandline(), $this->escape);
Function $this->commandline->getCommandline() returns escaped argument. Then Commandline::toString() escapes again with function escapeshellarg() called in Commandline::quoteArgument(). This second escaping converts quotation marks to spaces.
Fix: remove double escaping.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Version: Phing 2.15.2
Note: incomplete fix of https://www.phing.info/trac/ticket/1243
Tested on Windows
Steps
Execute command with argument which needs escape:
Expected
Command is executed:
echo "foo|bar" 2>&1
Actual
Command is executed:
echo " foo|bar " 2>&1
There are two unwanted spaces in argument.
Root cause
Argument is escaped twice. Look at row 229 in file ExecTask.php:
$this->realCommand = Commandline::toString($this->commandline->getCommandline(), $this->escape);
Function
$this->commandline->getCommandline()
returns escaped argument. ThenCommandline::toString()
escapes again with functionescapeshellarg()
called inCommandline::quoteArgument()
. This second escaping converts quotation marks to spaces.Fix: remove double escaping.
The text was updated successfully, but these errors were encountered: