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
Description
May not be a bug but the docs imply that the string form for Process command is the equivalent to the array form:
When a string command is passed to new Process() the arguments are not escaped, but when the array form is used they are correctly escaped. This example is on windows so ^ is an escape char.
As a result the string form of the same command is not portable whereas the array form is.
if you pass a single string, that command is executed as is. Any escaping has to be done on your own when building the command.
When passing an array, Symfony escape each argument for your (as it can know what the different parts of the command are as they are passed separately). and on Windows, ^ is a special char, so some escaping it needed (try running composer require ^7.1 in a cmd shell, and you will see that it will require 7.1, not ^7.1 as the ^ would be swallowed by cmd itself).
That's precisely the reason why the array syntax was added in 3.4 (older versions could rely on the ProcessBuilder to perform some escaping, but that was not working entirely fine, as it was performing this escaping too early to be able to handle 100% of cases properly).
Symfony version(s) affected: symfony/process 4.1.0
Description
May not be a bug but the docs imply that the string form for Process command is the equivalent to the array form:
When a string command is passed to
new Process()
the arguments are not escaped, but when the array form is used they are correctly escaped. This example is on windows so^
is an escape char.As a result the string form of the same command is not portable whereas the array form is.
The text was updated successfully, but these errors were encountered: