From 28625e5bc99c59f90db117ecfddf5533db11c61e Mon Sep 17 00:00:00 2001 From: Joshua Logsdon Date: Tue, 24 Mar 2015 14:33:21 -0400 Subject: array_fill() throws an error if count($var) is 0 Signed-off-by: Joshua Logsdon --- system/core/Common.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'system/core') diff --git a/system/core/Common.php b/system/core/Common.php index ee5a705b2..935c687ab 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -743,6 +743,12 @@ if ( ! function_exists('html_escape')) { 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)); } -- cgit v1.2.3-24-g4f1b