From 7f3d1e54f53d151237064bc1694adbd9703d00fe Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 9 Sep 2015 15:01:12 +0200 Subject: [PATCH] Fixed problems of header response of ajax. Tiquet: #2630 (cherry picked from commit cda76e17c1947b9271dc43501d9eed62f116627f) --- pandora_console/include/ajax/agent.php | 5 ++++- pandora_console/include/ajax/module.php | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/agent.php b/pandora_console/include/ajax/agent.php index 8ea2ec6058..53b6a515c9 100644 --- a/pandora_console/include/ajax/agent.php +++ b/pandora_console/include/ajax/agent.php @@ -28,6 +28,9 @@ enterprise_include_once ('include/functions_metaconsole.php'); $search_agents = (bool) get_parameter ('search_agents'); $get_agents_group = (bool) get_parameter('get_agents_group', false); $force_local = (bool) get_parameter('force_local', false); +if ( https_is_running() ) { + header('Content-type: application/json'); +} if ($get_agents_group) { $id_group = (int)get_parameter('id_group', -1); @@ -303,4 +306,4 @@ elseif ($search_agents && ($config['metaconsole'] == 1) && defined('METACONSOLE' echo json_encode($data); return; } -?> \ No newline at end of file +?> diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 2904992e12..30f6a76ff1 100644 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -32,6 +32,9 @@ $change_module_relation_updates = (bool) get_parameter('change_module_relation_u $get_id_tag = (bool) get_parameter('get_id_tag', 0); if ($get_plugin_macros) { + if ( https_is_running() ) { + header('Content-type: application/json'); + } $id_plugin = get_parameter('id_plugin', 0); $plugin_macros = db_get_value('macros', 'tplugin', 'id', @@ -47,6 +50,9 @@ if ($get_plugin_macros) { if ($search_modules) { + if ( https_is_running() ) { + header('Content-type: application/json'); + } $id_agents = json_decode(io_safe_output(get_parameter('id_agents'))); $filter = '%' . get_parameter('q', '') . '%'; $other_filter = json_decode(io_safe_output(get_parameter('other_filter')), true);