Merge branch 'ent-12866-agente-creado-por-tarea-mssql-disco-muestra-main-view-totalmente-vacia-error-500' into 'develop'

Ent 12866 agente creado por tarea mssql disco muestra main view totalmente vacia error 500

See merge request artica/pandorafms!6925
This commit is contained in:
Rafael Ameijeiras 2024-02-14 12:00:17 +00:00
commit c6170ee6f6
1 changed files with 8 additions and 3 deletions

View File

@ -116,9 +116,14 @@ if (empty($agent['os_version']) !== true) {
$agent['os_version'] = io_safe_output($agent['os_version']); $agent['os_version'] = io_safe_output($agent['os_version']);
if (strpos($agent['os_version'], '(') !== false) { if (strpos($agent['os_version'], '(') !== false) {
$os_name = preg_split('/[0-9]|[\(]/', $agent['os_version'])[0]; $os_name = preg_split('/[0-9]|[\(]/', $agent['os_version'])[0];
$os_version = explode($os_name, explode('(', $agent['os_version'])[0])[1]; if (strlen($os_name) === 0) {
$os_version_name = preg_split('/[\(]|[\)]/', $agent['os_version']); $os_name = get_os_name((int) $agent['id_os']);
$os_agent_text = $os_version.' ('.$os_version_name[1].')'; $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 { } else {
$os_name = preg_split('/[0-9]/', $agent['os_version'])[0]; $os_name = preg_split('/[0-9]/', $agent['os_version'])[0];
$os_agent_text = $agent['os_version']; $os_agent_text = $agent['os_version'];