Code Duplication    Length = 10-11 lines in 2 locations

class/xml.php 1 location

@@ 119-129 (lines=11) @@
116
         * @param $val
117
         * @return array|mixed|string
118
         */
119
        public function convert_encoding($val)
120
        {
121
            if (is_array($val)) {
122
                foreach (array_keys($val) as $key) {
123
                    $val[$key] = $this->convert_encoding($val[$key]);
124
                }
125
            } else {
126
                $val = XoopsLocal::convert_encoding($val, $this->encoding, _CHARSET);
127
            }
128
129
            return $val;
130
        }
131
132
        /**

class/xmlparser.php 1 location

@@ 201-210 (lines=10) @@
198
     * @param $val
199
     * @return array|mixed|string
200
     */
201
    public function _encoding($val)
202
    {
203
        if (is_array($val)) {
204
            foreach (array_keys($val) as $key) {
205
                $val[$key] = $this->_encoding($val[$key]);
206
            }
207
        } else {
208
            $val = XoopsLocal::convert_encoding($val, $this->charset_out, $this->charset_in);
209
        }
210
211
        return $val;
212
    }
213
}