Minor fixes in CI_Security::entity_decode()
diff --git a/system/core/Security.php b/system/core/Security.php
index da49776..9cef424 100644
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -656,7 +656,7 @@
 					{
 						$_entities[':'] = ':';
 						$_entities['('] = '(';
-						$_entities[')'] = '&rpar';
+						$_entities[')'] = ')';
 						$_entities["\n"] = '&newline;';
 						$_entities["\t"] = '&tab;';
 					}
@@ -664,11 +664,11 @@
 
 				$replace = array();
 				$matches = array_unique(array_map('strtolower', $matches[0]));
-				for ($i = 0, $c = count($matches); $i < $c; $i++)
+				foreach ($matches as &$match)
 				{
-					if (($char = array_search($matches[$i].';', $_entities, TRUE)) !== FALSE)
+					if (($char = array_search($match.';', $_entities, TRUE)) !== FALSE)
 					{
-						$replace[$matches[$i]] = $char;
+						$replace[$match] = $char;
 					}
 				}