Closed
Description
Symfony version(s) affected
4.4
Description
The Symphony component "Process" doesn't recognize the environment variable "Path", which leads to the fact that it's impossible to perform operations with the standard Windows utilities and other programs written in the "Path" variable.
How to reproduce
Windows-only: run script from a web server with the following code:
$registry_path = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows";
$pathname = "C:\\example.reg";
$command = 'reg save ' . '"' . $registry_path . '" "' . $pathname . '"';
$process = Process::fromShellCommandline($command);
$code = $process->run();
if (!$process->isSuccessful()) {
echo 'fail';
}
Possible Solution
Windows environment variables should be treated case-insensitively. Intersection of $_SERVER with getenv() is performed to get the default envs, but intersection in question is done in a case-sensitive manner, which leads to bugs in Windows.
Additional Context
Bug doesn't reproduce in a command line environment.