From 074a214ee829e2169058b7f07efdd44edcc3fc4f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Feb 2015 14:03:14 +0200 Subject: Fix #3579 --- system/core/Security.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core') diff --git a/system/core/Security.php b/system/core/Security.php index 7c18c7406..ccb141260 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -639,7 +639,7 @@ class CI_Security { $str_compare = $str; // Decode standard entities, avoiding false positives - if ($c = preg_match_all('/&[a-z]{2,}(?![a-z;])/i', $str, $matches)) + if (preg_match_all('/&[a-z]{2,}(?![a-z;])/i', $str, $matches)) { if ( ! isset($_entities)) { @@ -664,7 +664,7 @@ class CI_Security { $replace = array(); $matches = array_unique(array_map('strtolower', $matches[0])); - for ($i = 0; $i < $c; $i++) + for ($i = 0, $c = count($matches); $i < $c; $i++) { if (($char = array_search($matches[$i].';', $_entities, TRUE)) !== FALSE) { -- cgit v1.2.3-24-g4f1b