Skip to content

Commit

Permalink
minor #37466 [Console] Do not check for "stty" using "exec" if that f…
Browse files Browse the repository at this point in the history
…unction is disabled (mvorisek)

This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Console] Do not check for "stty" using "exec" if that function is disabled

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        | no

fixes PHP-CS-Fixer/PHP-CS-Fixer#5030

Commits
-------

02124b6 [Console] Do not check for "stty" using "exec" if that function is disabled
  • Loading branch information
nicolas-grekas committed Jul 1, 2020
2 parents 91f30e0 + 02124b6 commit 9f6acd5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Symfony/Component/Console/Terminal.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public static function hasSttyAvailable()
return self::$stty;
}

// skip check if exec function is disabled
if (!\function_exists('exec')) {
return false;
}

exec('stty 2>&1', $output, $exitcode);

return self::$stty = 0 === $exitcode;
Expand Down

0 comments on commit 9f6acd5

Please sign in to comment.