Code Duplication    Length = 6-10 lines in 2 locations

3rdparty/getID3/getid3/module.audio-video.quicktime.php 2 locations

@@ 2583-2588 (lines=6) @@
2580
            //check for BOM
2581
            if ($len > 2 && (($lstring[0] == "\xFE" && $lstring[1] == "\xFF") || ($lstring[0] == "\xFF" && $lstring[1] == "\xFE"))) {
2582
                //UTF-16
2583
                if (preg_match('/(.*)\x00/', $lstring, $lmatches)){
2584
                     $count = strlen($lmatches[1]) * 2 + 2; //account for 2 byte characters and trailing \x0000
2585
                    return getid3_lib::iconv_fallback_utf16_utf8($lmatches[1]);
2586
                } else {
2587
                    return '';
2588
                }
2589
            } else {
2590
                //UTF-8
2591
                if (preg_match('/(.*)\x00/', $lstring, $lmatches)){
@@ 2589-2598 (lines=10) @@
2586
                } else {
2587
                    return '';
2588
                }
2589
            } else {
2590
                //UTF-8
2591
                if (preg_match('/(.*)\x00/', $lstring, $lmatches)){
2592
                    $count = strlen($lmatches[1]) + 1; //account for trailing \x00
2593
                    return $lmatches[1];
2594
                }else {
2595
                    return '';
2596
                }
2597
2598
            }
2599
        }
2600
2601
	public function NoNullString($nullterminatedstring) {