From 59871345648657d063a53cd55307ba920f329536 Mon Sep 17 00:00:00 2001 From: limad <35463455+limad@users.noreply.github.com> Date: Sun, 10 Nov 2024 20:47:24 +0100 Subject: [PATCH] Update system.class.php Prevent PHP8 warning on trim() while param is null --- core/class/system.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/class/system.class.php b/core/class/system.class.php index 08146c2c28..d3e6147c0c 100644 --- a/core/class/system.class.php +++ b/core/class/system.class.php @@ -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; }