diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ac0ed6f6bc..ab8c1ace01 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-04-30 Miguel de Dios + + * include/functions_io.php: added in the function "safe_output" the flag + $utf8 for set the encoding of output, by default true. + 2010-04-29 Miguel de Dios * godmode/reporting/reporting_builder.item_editor.php: fixed typo mistake in diff --git a/pandora_console/include/functions_io.php b/pandora_console/include/functions_io.php index c50de50e03..fbee69fb33 100755 --- a/pandora_console/include/functions_io.php +++ b/pandora_console/include/functions_io.php @@ -43,11 +43,12 @@ function safe_input($value) { * who doesn't make the HTML render by itself. * * @param mixed String or array of strings to be cleaned. + * @param boolean $utf8 Flag, set the output encoding in utf8, by default true. * * @return unknown_type */ -function safe_output($value) -{ +function safe_output($value, $utf8 = true) +{ if (is_numeric($value)) return $value; @@ -59,7 +60,12 @@ function safe_output($value) if (! mb_check_encoding ($value, 'UTF-8')) $value = utf8_encode ($value); - $valueHtmlEncode = html_entity_decode ($value, ENT_QUOTES, "UTF-8"); + if ($utf8) { + $valueHtmlEncode = html_entity_decode ($value, ENT_QUOTES, "UTF-8"); + } + else { + $valueHtmlEncode = html_entity_decode ($value, ENT_QUOTES); + } return $valueHtmlEncode; }