Fix E_WARNING in CI_Security::entity_decode() on PHP<5.3.4
Related: #3057
Previous commit: 487d1ae060e6414e0a59c9752a4914fa3b8c4710
diff --git a/system/core/Security.php b/system/core/Security.php
index 8ad0518..6b11405 100755
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -644,7 +644,12 @@
{
if ( ! isset($_entities))
{
- $_entities = array_map('strtolower', get_html_translation_table(HTML_ENTITIES, $flag, $charset));
+ $_entities = array_map(
+ 'strtolower',
+ is_php('5.3.4')
+ ? get_html_translation_table(HTML_ENTITIES, $flag, $charset)
+ : get_html_translation_table(HTML_ENTITIES, $flag)
+ );
// If we're not on PHP 5.4+, add the possibly dangerous HTML 5
// entities to the array manually