diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index 3abdaa78d8..c734955ce2 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -45,7 +45,7 @@ if(get_magic_quotes_gpc() && is_array($_POST['newsettings'])) { - $_POST['newsettings'] = array_map("stripslashes", $_POST['newsettings']); + $_POST['newsettings'] = $this->array_stripslashes($_POST['newsettings']); } switch($_GET['appname']) @@ -250,5 +250,24 @@ $t->set_var('lang_cancel', lang('Cancel')); $t->pfp('out','footer'); } + + /** + * applies stripslashes recursivly on each element of an array + * + * @param array &$var + * @return array + */ + function array_stripslashes($var) + { + if (!is_array($var)) + { + return stripslashes($var); + } + foreach($var as $key => $val) + { + $var[$key] = is_array($val) ? $this->array_stripslashes($val) : stripslashes($val); + } + return $var; + } } ?>