From 4670ed922ace9c433d510990fda3d7c92d83d5f6 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 9 Jan 2020 17:25:24 +0100 Subject: [PATCH 1/3] Added control for correct UTF8 encoding --- pandora_console/godmode/agentes/module_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index b7b1d296ec..78327f7dfd 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -830,7 +830,7 @@ foreach ($modules as $module) { $data[4] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true); } - $data[5] = ui_print_truncate_text($module['descripcion'], 'description', false); + $data[5] = ui_print_truncate_text(utf8_decode($module['descripcion']), 'description', false); $data[6] = ui_print_status_image($status, $title, true); From 5b08e71ec6666f9c04ff7b901f69f1e73fd52569 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 6 Feb 2020 13:02:58 +0100 Subject: [PATCH 2/3] Solved issue with UTF8 chars in configuration_data field --- pandora_console/godmode/agentes/module_manager.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 78327f7dfd..38faf0e7df 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -830,7 +830,14 @@ foreach ($modules as $module) { $data[4] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true); } - $data[5] = ui_print_truncate_text(utf8_decode($module['descripcion']), 'description', false); + + if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) { + $module_description = utf8_decode($module['descripcion']); + } else { + $module_description = $module['descripcion']; + } + + $data[5] = ui_print_truncate_text($module_description, 'description', false); $data[6] = ui_print_status_image($status, $title, true); From 0b7d4a9463bd3392b7004ae25562cc8f2f969a7d Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 10 Feb 2020 11:16:57 +0100 Subject: [PATCH 3/3] Added solution for UTF8 charset in treeview and main agent view --- pandora_console/include/ajax/module.php | 8 +++++++- pandora_console/include/functions_treeview.php | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index bf528cbaca..68c6ab939e 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1004,8 +1004,14 @@ if (check_login()) { $data[3] .= ' '.html_print_image('images/link2.png', true, ['id' => 'relations-details-'.$module['id_agente_modulo'], 'class' => 'img_help']).' '; } + $module_description = ''; + if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) { + $module_description = utf8_decode($module['descripcion']); + } else { + $module_description = $module['descripcion']; + } - $data[4] = ui_print_string_substr($module['descripcion'], 60, true, 8); + $data[4] = ui_print_string_substr($module_description, 60, true, 8); if ($module['datos'] != strip_tags($module['datos'])) { diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 558cc0f061..a15b0f93d9 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -95,7 +95,7 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals $row = []; $row['title'] = __('Warning status'); $row['data'] = $warning_status_str; - $table->data['watning_status'] = $row; + $table->data['warning_status'] = $row; // Critical Min/Max if (modules_is_string_type($module['id_tipo_modulo'])) { @@ -124,9 +124,16 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals $table->data['module_group'] = $row; // Description + $module_description = ''; + if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) { + $module_description = utf8_decode($module['descripcion']); + } else { + $module_description = $module['descripcion']; + } + $row = []; $row['title'] = __('Description'); - $row['data'] = ui_print_truncate_text($module['descripcion'], 'description', true, true, true, '[…]'); + $row['data'] = ui_print_truncate_text($module_description, 'description', true, true, true, '[…]'); $table->data['description'] = $row; // Tags