diff options
author | Andrey Andreev <narf@devilix.net> | 2014-10-05 23:04:19 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-10-05 23:04:19 +0200 |
commit | 4a485a73d64a8bebc7625aabc5fdc361d5e7dc56 (patch) | |
tree | cb18690c4de1c6ca008227260f9dd0cd2b9279d2 /system/core/Common.php | |
parent | 39ec29585b7cdca7edc1a0757c913a13a2ee4f85 (diff) | |
parent | d444d445ed0458a352ecb9ff79ffd158677ee805 (diff) |
Merge branch 'develop' into feature/session
Diffstat (limited to 'system/core/Common.php')
-rw-r--r-- | system/core/Common.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index 752a2e7f1..504e22571 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -289,7 +289,7 @@ if ( ! function_exists('config_item')) $_config[0] =& get_config(); } - return isset($_config[0][$item]) ? $_config[0][$item] : FALSE; + return isset($_config[0][$item]) ? $_config[0][$item] : NULL; } } @@ -690,16 +690,20 @@ if ( ! function_exists('remove_invisible_characters')) if ( ! function_exists('html_escape')) { /** - * Returns HTML escaped variable + * Returns HTML escaped variable. * - * @param mixed - * @return mixed + * @param mixed $var The input string or array of strings to be escaped. + * @param bool $double_encode $double_encode set to FALSE prevents escaping twice. + * @return mixed The escaped string or array of strings as a result. */ - function html_escape($var) + function html_escape($var, $double_encode = TRUE) { - return is_array($var) - ? array_map('html_escape', $var) - : htmlspecialchars($var, ENT_QUOTES, config_item('charset')); + if (is_array($var)) + { + return array_map('html_escape', $var, array_fill(0, count($var), $double_encode)); + } + + return htmlspecialchars($var, ENT_QUOTES, config_item('charset'), $double_encode); } } |