From d140da563c4593b98e2f07d31130a69293e93774 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 May 2016 07:22:37 +0000 Subject: [PATCH] using global array_stripslashes function --- etemplate/inc/class.etemplate.inc.php | 13 +++---------- infolog/inc/class.infolog_ui.inc.php | 23 ----------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index 95f6e266d8..acd6bd850f 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -2188,18 +2188,11 @@ class etemplate extends boetemplate * * @param array &$var * @return array + * @deprecated use global array_stripslashes */ static function array_stripslashes($var) { - if (!is_array($var)) - { - return stripslashes($var); - } - foreach($var as $key => $val) - { - $var[$key] = is_array($val) ? self::array_stripslashes($val) : stripslashes($val); - } - return $var; + return array_stripslashes($var); } /** @@ -2229,7 +2222,7 @@ class etemplate extends boetemplate $content = array(); if (get_magic_quotes_gpc()) { - $content_in = self::array_stripslashes($content_in); + $content_in = array_stripslashes($content_in); } self::$validation_errors = array(); $this->canceled = $this->button_pressed = False; diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 8ddf9442a9..fe0f1b4f91 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -2374,29 +2374,6 @@ class infolog_ui return $icon ? Api\Html::image('infolog',$icon,lang($alt),'border=0') : lang($alt); } - /** - * stripping slashes from an array - * - * @static - * @param array $arr - * @return array - */ - function array_stripslashes($arr) - { - foreach($arr as $key => $val) - { - if (is_array($val)) - { - $arr[$key] = self::array_stripslashes($val); - } - else - { - $arr[$key] = stripslashes($val); - } - } - return $arr; - } - /** * Infolog's site configuration *