Code Duplication    Length = 10-11 lines in 2 locations

htdocs/lib2/Net/IDNA2.php 2 locations

@@ 2372-2381 (lines=10) @@
2369
                        );
2370
                    }
2371
                    // Skip first char
2372
                    if ($k) {
2373
                        $encoded = '';
2374
                        $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k) - $last_begin)));
2375
                        if ($encoded) {
2376
                            $output .= $encoded;
2377
                        } else {
2378
                            $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k) - $last_begin)));
2379
                        }
2380
                        $output .= chr($decoded[$k]);
2381
                    }
2382
                    $last_begin = $k + 1;
2383
            }
2384
        }
@@ 2386-2396 (lines=11) @@
2383
            }
2384
        }
2385
        // Catch the rest of the string
2386
        if ($last_begin) {
2387
            $inp_len = sizeof($decoded);
2388
            $encoded = '';
2389
            $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len) - $last_begin)));
2390
            if ($encoded) {
2391
                $output .= $encoded;
2392
            } else {
2393
                $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len) - $last_begin)));
2394
            }
2395
2396
            return $output;
2397
        }
2398
2399
        if ($output = $this->_encode($decoded)) {