From 6b795ed511e4618e6bb5b76b0ddd2fcfacce2e24 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 29 Oct 2025 11:38:33 -0600 Subject: [PATCH] Fix the service runtime - The trim is required - To prevent an error by using: ?? '' --- app/system/resources/dashboard/system_services.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/system/resources/dashboard/system_services.php b/app/system/resources/dashboard/system_services.php index 04ccee685d..8dd860d51d 100644 --- a/app/system/resources/dashboard/system_services.php +++ b/app/system/resources/dashboard/system_services.php @@ -57,9 +57,9 @@ if (!function_exists('is_running')) { function is_running(string $name) { $name = escapeshellarg($name); - $pid = shell_exec("ps -aux | grep $name | grep -v grep | awk '{print \$2}' | head -n 1"); + $pid = trim(shell_exec("ps -aux | grep $name | grep -v grep | awk '{print \$2}' | head -n 1") ?? ''); if ($pid && is_numeric($pid)) { - $etime = shell_exec("ps -p $pid -o etime= | tr -d '\n'"); + $etime = trim(shell_exec("ps -p $pid -o etime= | tr -d '\n'") ?? ''); return ['running' => true, 'pid' => $pid, 'etime' => $etime]; } return ['running' => false, 'pid' => null, 'etime' => null];