8000 [Process] Recommend double quotes with placeholders · symfony/symfony@916ff7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 916ff7a

Browse files
author
Chris McGehee
committed
[Process] Recommend double quotes with placeholders
1 parent fa6a03a commit 916ff7a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ public function __construct($command, string $cwd = null, array $env = null, $in
180180
* $process = Process::fromShellCommandline('my_command "$MY_VAR"');
181181
* $process->run(null, ['MY_VAR' => $theValue]);
182182
*
183+
* It is also recommended to use double quotes around placeholders. This will help ensure the value
184+
* of the placeholder is passed as a single argument which can help avoid security issues.
185+
*
183186
* @param string $command The command line to pass to the shell of the OS
184187
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
185188
* @param array|null $env The environment variables or null to use the same environment as the current PHP process

0 commit comments

Comments
 (0)
0