summaryrefslogtreecommitdiffstats
path: root/system/core/Common.php
diff options
context:
space:
mode:
authorIvan Tcholakov <ivantcholakov@gmail.com>2014-08-25 14:48:33 +0200
committerIvan Tcholakov <ivantcholakov@gmail.com>2014-08-25 14:48:33 +0200
commit6222437cfec313a33bc1d6546c4de139c4688188 (patch)
tree0e586d6c822ca4c3375674ac0c9c8fa1c693d788 /system/core/Common.php
parente7f55bf4afccbfa65bca16be63d6987ef3224431 (diff)
Upgrading the function html_escape() - Readability Improvement 2.
Diffstat (limited to 'system/core/Common.php')
-rw-r--r--system/core/Common.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 93f0f0a99..ec44ea815 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -700,11 +700,17 @@ if ( ! function_exists('html_escape'))
{
$double_encode = (bool) $double_encode;
- return is_array($var)
- ? ($double_encode === FALSE
- ? array_map('html_escape', $var, array_fill(0, count($var), FALSE))
- : array_map('html_escape', $var))
- : htmlspecialchars($var, ENT_QUOTES, config_item('charset'), $double_encode);
+ if (is_array($var))
+ {
+ if ($double_encode)
+ {
+ return array_map('html_escape', $var);
+ }
+
+ return array_map('html_escape', $var, array_fill(0, count($var), FALSE));
+ }
+
+ return htmlspecialchars($var, ENT_QUOTES, config_item('charset'), $double_encode);
}
}