Skip to content

Commit f653612

Browse files
committed
[Console] Add shell_exec check to Terminal::hasSttyAvailable()
1 parent 6166fc4 commit f653612

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Console/Terminal.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public static function hasSttyAvailable(): bool
6565
}
6666

6767
// skip check if exec function is disabled
68-
if (!\function_exists('exec')) {
68+
// shell_exec is very often used in the codebase after a Terminal::hasSttyAvailable() check, which can lead to a "Call to undefined function" error.
69+
if (!\function_exists('exec') || !\function_exists('shell_exec')) {
6970
return false;
7071
}
7172

0 commit comments

Comments
 (0)