Code Duplication    Length = 4-4 lines in 2 locations

system/objects/IdnaConvert.php 2 locations

@@ 230-233 (lines=4) @@
227
            $parsed = parse_url($input);
228
            if (isset($parsed['host'])) {
229
                $arr = explode('.', $parsed['host']);
230
                foreach ($arr as $k => $v) {
231
                    $conv = $this->_decode($v);
232
                    if ($conv) $arr[$k] = $conv;
233
                }
234
                $parsed['host'] = join('.', $arr);
235
                $return =
236
                        (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://'))
@@ 245-248 (lines=4) @@
242
                        .(empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']);
243
            } else { // parse_url seems to have failed, try without it
244
                $arr = explode('.', $input);
245
                foreach ($arr as $k => $v) {
246
                    $conv = $this->_decode($v);
247
                    $arr[$k] = ($conv) ? $conv : $v;
248
                }
249
                $return = join('.', $arr);
250
            }
251
        } else { // Otherwise we consider it being a pure domain name string