From 301ca0f7106c9fc4f5da29182e2904b66c897a83 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 12 Feb 2024 09:42:20 +0100 Subject: [PATCH] #12866 Fix Other OS name and version in Agent view --- .../operation/agentes/estado_generalagente.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index de439aecb8..6a1fa988d3 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -116,9 +116,14 @@ if (empty($agent['os_version']) !== true) { $agent['os_version'] = io_safe_output($agent['os_version']); if (strpos($agent['os_version'], '(') !== false) { $os_name = preg_split('/[0-9]|[\(]/', $agent['os_version'])[0]; - $os_version = explode($os_name, explode('(', $agent['os_version'])[0])[1]; - $os_version_name = preg_split('/[\(]|[\)]/', $agent['os_version']); - $os_agent_text = $os_version.' ('.$os_version_name[1].')'; + if (strlen($os_name) === 0) { + $os_name = get_os_name((int) $agent['id_os']); + $os_agent_text = $agent['os_version']; + } else { + $os_version = explode($os_name, explode('(', $agent['os_version'])[0])[1]; + $os_version_name = preg_split('/[\(]|[\)]/', $agent['os_version']); + $os_agent_text = $os_version.' ('.$os_version_name[1].')'; + } } else { $os_name = preg_split('/[0-9]/', $agent['os_version'])[0]; $os_agent_text = $agent['os_version'];