From a1655972a675ee75368ec06db7cc9d7aad01a610 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 2 Jul 2013 15:38:49 +0000 Subject: [PATCH] 2013-07-02 Sergio Martin * include/functions_api.php: Changed the way of encode data configuration in create/update config form API git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8450 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_api.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 4c8dc204d6..fa6b01baf1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-07-02 Sergio Martin + + * include/functions_api.php: Changed the way of encode + data configuration in create/update config form API + 2013-07-02 Miguel de Dios * include/functions_networkmap.php, diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 32bc69ed81..8ae99cbd6e 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -3359,8 +3359,8 @@ function api_set_update_plugin_module_policy($id, $thrash1, $other, $thrash3) { * @return string 0 when success, -1 when error, -2 if already exist */ function api_set_add_module_in_conf($id_agent, $module_name, $configuration_data, $thrash3) { - $new_configuration_data = base64_decode($configuration_data['data']); - + $new_configuration_data = io_safe_output(urldecode($configuration_data['data'])); + // Check if exist a current module with the same name in the conf file $old_configuration_data = config_agents_get_module_from_conf($id_agent, io_safe_output($module_name)); @@ -3448,7 +3448,7 @@ function api_set_delete_module_in_conf($id_agent, $module_name, $thrash2, $thras * @return string 0 when success, 1 when no changes, -1 when error, -2 if doesnt exist */ function api_set_update_module_in_conf($id_agent, $module_name, $configuration_data_serialized, $thrash3) { - $new_configuration_data = base64_decode($configuration_data_serialized['data']); + $new_configuration_data = io_safe_output(urldecode($configuration_data_serialized['data'])); // Get current configuration $old_configuration_data = config_agents_get_module_from_conf($id_agent, io_safe_output($module_name));