Return empty $var immediately
Signed-off-by: Joshua Logsdon <logsdon.joshua@gmail.com>
diff --git a/system/core/Common.php b/system/core/Common.php
index 935c687..2b1e844 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -741,14 +741,14 @@
*/
function html_escape($var, $double_encode = TRUE)
{
+ // If empty, skip escaping
+ if (empty($var))
+ {
+ return $var;
+ }
+
if (is_array($var))
{
- // If empty array, skip escaping
- if ( empty($var) )
- {
- return $var;
- }
-
return array_map('html_escape', $var, array_fill(0, count($var), $double_encode));
}