diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a181dba723..ad86923c66 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-03-04 Miguel de Dios + + * include/functions_api.php: fixed the function "api_get_gis_agent". + Thanks Cucumber. + + * include/functions_io.php: cleaned source code style. + 2014-03-03 Miguel de Dios * include/functions_api.php: fixed the call "get_total_modules" now diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 48e8618f7c..4c0bafe8ab 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -133,8 +133,11 @@ function returnData($returnType, $data, $separator = ';') { } else { if (!empty($data['data'])) { + foreach ($data['data'] as $dataContent) { + $clean = array_map("array_apply_io_safe_output", $dataContent); + foreach ($clean as $k => $v) { $clean[$k] = str_replace("\r", "\n", $clean[$k]); $clean[$k] = str_replace("\n", " ", $clean[$k]); @@ -5249,7 +5252,7 @@ function api_get_gis_agent($id_agent, $trash1, $tresh2, $return_type, $user_in_d if ($agent_gis_data) { returnData($return_type, - array('type' => 'array', 'data' => $agent_gis_data)); + array('type' => 'array', 'data' => array($agent_gis_data))); } else { returnError('Error.'); diff --git a/pandora_console/include/functions_io.php b/pandora_console/include/functions_io.php index 0b19a79547..a7fee2ae0a 100755 --- a/pandora_console/include/functions_io.php +++ b/pandora_console/include/functions_io.php @@ -229,7 +229,7 @@ function io_safe_output($value, $utf8 = true) $valueHtmlEncode = str_replace("<", '<', $valueHtmlEncode); //Replace the html entitie of > for the char - $valueHtmlEncode = str_replace(">", '>', $valueHtmlEncode); + $valueHtmlEncode = str_replace(">", '>', $valueHtmlEncode); //Revert html entities to chars for ($i=0;$i<33;$i++) {