2014-04-19 Junichi Satoh <junichi@rworks.jp>

* godmode/agentes/agent_manager.php,
	godmode/agentes/agent_wizard.snmp_explorer.php,
	godmode/agentes/configurar_agente.php,
	godmode/agentes/module_manager_editor.php,
	godmode/agentes/module_manager_editor_common.php: Replaced
	json_encode() with io_json_mb_encode() to avoid invalid encoding
	with multi-byte characters.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9783 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2014-04-19 01:35:53 +00:00
parent 4b2fc49e07
commit cc2c6eab38
6 changed files with 27 additions and 17 deletions

View File

@ -1,3 +1,13 @@
2014-04-19 Junichi Satoh <junichi@rworks.jp>
* godmode/agentes/agent_manager.php,
godmode/agentes/agent_wizard.snmp_explorer.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_common.php: Replaced
json_encode() with io_json_mb_encode() to avoid invalid encoding
with multi-byte characters.
2014-04-16 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/d3.v3.4.5.js: added the last javascript

View File

@ -49,7 +49,7 @@ if (is_ajax ()) {
'ip' => io_safe_output($agent['direccion']));
}
echo json_encode($data);
echo io_json_mb_encode($data);
return;
}
@ -86,7 +86,7 @@ if (is_ajax ()) {
$oid_snmp = array();
}
echo json_encode($out);
echo io_json_mb_encode($out);
}
return;

View File

@ -442,7 +442,7 @@ if ($create_modules) {
}
}
$module_values['macros'] = json_encode($macros);
$module_values['macros'] = io_json_mb_encode($macros);
unset($module_values['snmp_community']); //snmp_community
unset($module_values['ip_target']); //ip_target
@ -488,7 +488,7 @@ if ($create_modules) {
}
}
$module_values['macros'] = json_encode($macros);
$module_values['macros'] = io_json_mb_encode($macros);
unset($module_values['snmp_community']); //snmp_community
unset($module_values['ip_target']); //ip_target
@ -528,7 +528,7 @@ if ($create_modules) {
}
}
$module_values['macros'] = json_encode($macros);
$module_values['macros'] = io_json_mb_encode($macros);
unset($module_values['snmp_community']); //snmp_community
unset($module_values['ip_target']); //ip_target

View File

@ -843,7 +843,7 @@ if ($update_module || $create_module) {
$macros[$k]['value'] = get_parameter($m['macro'], '');
}
$macros = json_encode($macros);
$macros = io_json_mb_encode($macros);
$conf_array = explode("\n",$configuration_data);
foreach($conf_array as $line) {
@ -944,7 +944,7 @@ if ($update_module || $create_module) {
$throw_unknown_events = (bool)get_parameter('throw_unknown_events', false);
//Set the event type that can show.
$disabled_types_event = array(EVENTS_GOING_UNKNOWN => (int)!$throw_unknown_events);
$disabled_types_event = json_encode($disabled_types_event);
$disabled_types_event = io_json_mb_encode($disabled_types_event);
$module_macro_names = (array) get_parameter('module_macro_names', array());
$module_macro_values = (array) get_parameter('module_macro_values', array());
@ -1066,7 +1066,7 @@ if ($update_module) {
$agent = db_get_row ('tagente', 'id_agente', $id_agente);
db_pandora_audit("Agent management",
"Updated module '$name' for agent ".$agent["nombre"], false, false, json_encode($values));
"Updated module '$name' for agent ".$agent["nombre"], false, false, io_json_mb_encode($values));
}
}
@ -1189,7 +1189,7 @@ if ($create_module) {
$agent = db_get_row ('tagente', 'id_agente', $id_agente);
db_pandora_audit("Agent management",
"Added module '$name' for agent ".$agent["nombre"], false, true, json_encode($values));
"Added module '$name' for agent ".$agent["nombre"], false, true, io_json_mb_encode($values));
}
}

View File

@ -33,7 +33,7 @@ if (is_ajax ()) {
!network_components_is_disable_type_event($id_component, EVENTS_GOING_UNKNOWN);
echo json_encode ($component);
echo io_json_mb_encode ($component);
return;
}
@ -47,7 +47,7 @@ if (is_ajax ()) {
'order' => 'name ASC'),
array ('id_nc', 'name'));
echo json_encode ($components);
echo io_json_mb_encode ($components);
return;
}
@ -60,7 +60,7 @@ if (is_ajax ()) {
array('id_network_component_group' => $id_module_group),
array('id', 'name'));
echo json_encode($localComponents);
echo io_json_mb_encode($localComponents);
return;
}
@ -93,7 +93,7 @@ if (is_ajax ()) {
$component['throw_unknown_events'] =
!local_components_is_disable_type_event($id_component, EVENTS_GOING_UNKNOWN);
echo json_encode ($component);
echo io_json_mb_encode ($component);
return;
}
@ -123,7 +123,7 @@ if (is_ajax ()) {
1, "", $snmp_port);
if ($snmpwalk === false) {
echo json_encode ($snmpwalk);
echo io_json_mb_encode ($snmpwalk);
return;
}
@ -133,7 +133,7 @@ if (is_ajax ()) {
$result[$id] = substr ($value, 0, 55);
}
asort ($result);
echo json_encode ($result);
echo io_json_mb_encode ($result);
return;
}

View File

@ -182,7 +182,7 @@ if (!$edit) {
}
$table_simple->data[1][1] = '<em>'.modules_get_moduletype_description ($id_module_type).' ('.$type_names_hash[$id_module_type].')</em>';
$table_simple->data[1][1] .= html_print_input_hidden('type_names',base64_encode(json_encode($type_names_hash)),true);
$table_simple->data[1][1] .= html_print_input_hidden('type_names',base64_encode(io_json_mb_encode($type_names_hash)),true);
}
else {
if (isset($id_module_type)) {
@ -215,7 +215,7 @@ else {
$type_names_hash[$tn['id_tipo']] = $tn['nombre'];
}
$table_simple->data[1][1] .= html_print_input_hidden('type_names',base64_encode(json_encode($type_names_hash)),true);
$table_simple->data[1][1] .= html_print_input_hidden('type_names',base64_encode(io_json_mb_encode($type_names_hash)),true);
}
$table_simple->data[1][2] = __('Module group');