Skip to content

Commit

Permalink
bug #53481 [Process] Fix executable finder when the command starts wi…
Browse files Browse the repository at this point in the history
…th a dash (kayw-geek)

This PR was submitted for the 7.1 branch but it was merged into the 5.4 branch instead.

Discussion
----------

[Process] Fix executable finder when the command starts with a dash

| Q             | A
| ------------- | ---
| Branch?       |  5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #53479
| License       | MIT

Commits
-------

8ceaa8e [Process] Fix executable finder when the command starts with a dash
  • Loading branch information
nicolas-grekas committed Jan 11, 2024
2 parents fa9bf2d + 8ceaa8e commit f626a2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/PhpExecutableFinder.php
Expand Up @@ -35,7 +35,7 @@ public function find(bool $includeArgs = true)
{
if ($php = getenv('PHP_BINARY')) {
if (!is_executable($php)) {
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v --';
if ($php = strtok(exec($command.' '.escapeshellarg($php)), \PHP_EOL)) {
if (!is_executable($php)) {
return false;
Expand Down

0 comments on commit f626a2c

Please sign in to comment.