[SOLVED] Codeigniter: The each() function is deprecated

Masalah: ketika mengaktifkan $config['global_xss_filtering'] = TRUE;
Solusi:
Edit file /system/core/Security.php
Ubah :
public function xss_clean($str, $is_image = FALSE)
{
// Is the string an array?
if (is_array($str))
{
while (list($key) = each($str))
{
$str[$key] = $this->xss_clean($str[$key]);
}
return $str;
}

Jadi
public function xss_clean($str, $is_image = FALSE)
{
// Is the string an array?
if (is_array($str))
{
                        foreach($str as $key => $val) {
$str[$key] = $this->xss_clean($str[$key]);
                        }
return $str;
}

0 Response to "[SOLVED] Codeigniter: The each() function is deprecated"

Posting Komentar