Skip to content

Commit

Permalink
Update system.class.php
Browse files Browse the repository at this point in the history
Prevent PHP8 warning on trim() while param is null
  • Loading branch information
limad authored Nov 10, 2024
1 parent 08b57d5 commit 5987134
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/class/system.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ public static function ps($_find, $_without = null) {
$cmd .= ' | grep -v "' . $value . '"';
}
}
$results = explode("\n", trim(shell_exec($cmd)));
$execCmd = shell_exec($cmd);
if(!$execCmd){
return $return;
}
$results = explode("\n", trim($execCmd));
if (!is_array($results) || count($results) == 0) {
return $return;
}
Expand Down

0 comments on commit 5987134

Please sign in to comment.