2009-06-08 Esteban Sanchez <estebans@artica.es>

* include/functions.php: Added encoding checking on safe_input().
        Fixes #2797399.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1731 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2009-06-08 13:42:13 +00:00
parent 626308ba6f
commit 7225a9cf5a
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2009-06-08 Esteban Sanchez <estebans@artica.es>
* include/functions.php: Added encoding checking on safe_input().
Fixes #2797399.
2009-06-08 Esteban Sanchez <estebans@artica.es>
* godmode/reporting/reporting_builder.php: Replaced SQL with pandora

View File

@ -41,7 +41,9 @@ function safe_input ($value) {
}
if (version_compare (PHP_VERSION, '5.2.3') === 1) {
return htmlentities (utf8_encode ($value), ENT_QUOTES, "UTF-8", false);
if (! mb_check_encoding ($value, 'UTF-8'))
$value = utf8_encode ($value);
return htmlentities ($value, ENT_QUOTES, "UTF-8", false);
} else {
$translation_table = get_html_translation_table (HTML_ENTITIES, ENT_QUOTES);
$translation_table[chr(38)] = '&';