#12824 fixed create agent view

This commit is contained in:
Daniel Cebrian 2024-01-31 15:02:20 +01:00
parent 5ea053800a
commit 8bf3794072

View File

@ -507,14 +507,16 @@ if (enterprise_installed()) {
// Read configuration file. // Read configuration file.
$files = config_agents_get_agent_config_filenames($id_agente); $files = config_agents_get_agent_config_filenames($id_agente);
$file_name = $files['conf']; $file_name = $files['conf'];
$agent_config = file_get_contents($file_name); if (empty($file_name) === false) {
$encoding = 'UTF-8'; $agent_config = file_get_contents($file_name);
$agent_config_utf8 = mb_convert_encoding($agent_config, 'UTF-8', $encoding); $encoding = 'UTF-8';
if ($agent_config_utf8 !== false) { $agent_config_utf8 = mb_convert_encoding($agent_config, 'UTF-8', $encoding);
$agent_config = $agent_config_utf8; if ($agent_config_utf8 !== false) {
} $agent_config = $agent_config_utf8;
}
$broker = str_contains($agent_config, '#broker active'); $broker = str_contains($agent_config, '#broker active');
}
} }
if ($broker === false) { if ($broker === false) {