Skip to content

Commit

Permalink
[11.x] Fixes escaping path via Process given as array (#51926)
Browse files Browse the repository at this point in the history
Introduced in symfony/symfony#52409 we no longer
should use `Illuminate\Support\ProcessUtils::escapeArgument()` unless
calling `Process` via `Process::fromShellCommandline()`

fixes #51820

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Jun 27, 2024
1 parent 8258a7c commit 28b5d4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ protected function findComposerFile()
*/
protected function phpBinary()
{
return ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
return (string) (new PhpExecutableFinder)->find(false);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions tests/Support/SupportComposerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public function testDumpAutoloadRunsTheCorrectCommand()

public function testDumpAutoloadRunsTheCorrectCommandWhenCustomComposerPharIsPresent()
{
$escape = '\\' === DIRECTORY_SEPARATOR ? '"' : '\'';

$expectedProcessArguments = [$escape.PHP_BINARY.$escape, 'composer.phar', 'dump-autoload'];
$expectedProcessArguments = [PHP_BINARY, 'composer.phar', 'dump-autoload'];
$customComposerPhar = true;

$composer = $this->mockComposer($expectedProcessArguments, $customComposerPhar);
Expand Down

0 comments on commit 28b5d4e

Please sign in to comment.