Skip to content

Commit

Permalink
Merge branch 'config_shell_exec_check' of https://github.com/MasterOd…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Dec 8, 2019
2 parents a2bde79 + 32a789c commit 47cf41b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ public function __set($name, $value)
switch ($name) {
case 'reportWidth' :
// Support auto terminal width.
if ($value === 'auto' && preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1) {
if ($value === 'auto'
&& function_exists('shell_exec') === true
&& preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1
) {
$value = (int) $matches[1];
} else {
$value = (int) $value;
Expand Down

0 comments on commit 47cf41b

Please sign in to comment.