Code Duplication    Length = 3-3 lines in 11 locations

src/wp-includes/ID3/module.tag.id3v2.php 11 locations

@@ 634-636 (lines=3) @@
631
				$frame_textencoding_terminator = "\x00";
632
			}
633
			$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
634
			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
635
				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
636
			}
637
			$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
638
			if (ord($frame_description) === 0) {
639
				$frame_description = '';
@@ 727-729 (lines=3) @@
724
				$frame_textencoding_terminator = "\x00";
725
			}
726
			$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
727
			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
728
				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
729
			}
730
			$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
731
732
			if (ord($frame_description) === 0) {
@@ 738-740 (lines=3) @@
735
			$parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));
736
737
			$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator);
738
			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
739
				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
740
			}
741
			if ($frame_terminatorpos) {
742
				// there are null bytes after the data - this is not according to spec
743
				// only use data up to first null byte
@@ 970-972 (lines=3) @@
967
			$frame_language = substr($parsedFrame['data'], $frame_offset, 3);
968
			$frame_offset += 3;
969
			$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
970
			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
971
				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
972
			}
973
			$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
974
			if (ord($frame_description) === 0) {
975
				$frame_description = '';
@@ 1034-1036 (lines=3) @@
1031
				if ($frame_terminatorpos === false) {
1032
					$frame_remainingdata = '';
1033
				} else {
1034
					if (ord(substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
1035
						$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
1036
					}
1037
					$parsedFrame['lyrics'][$timestampindex]['data'] = substr($frame_remainingdata, $frame_offset, $frame_terminatorpos - $frame_offset);
1038
1039
					$frame_remainingdata = substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator));
@@ 1078-1080 (lines=3) @@
1075
				$frame_language = substr($parsedFrame['data'], $frame_offset, 3);
1076
				$frame_offset += 3;
1077
				$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
1078
				if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
1079
					$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
1080
				}
1081
				$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
1082
				if (ord($frame_description) === 0) {
1083
					$frame_description = '';
@@ 1382-1384 (lines=3) @@
1379
				$info['warning'][] = 'data portion of APIC frame is missing at offset '.($parsedFrame['dataoffset'] + 8 + $frame_offset);
1380
			} else {
1381
				$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
1382
				if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
1383
					$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
1384
				}
1385
				$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
1386
				if (ord($frame_description) === 0) {
1387
					$frame_description = '';
@@ 1496-1498 (lines=3) @@
1493
			$frame_offset = $frame_terminatorpos + strlen("\x00");
1494
1495
			$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
1496
			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
1497
				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
1498
			}
1499
			$frame_filename = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
1500
			if (ord($frame_filename) === 0) {
1501
				$frame_filename = '';
@@ 1506-1508 (lines=3) @@
1503
			$frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);
1504
1505
			$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
1506
			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
1507
				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
1508
			}
1509
			$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
1510
			if (ord($frame_description) === 0) {
1511
				$frame_description = '';
@@ 1778-1780 (lines=3) @@
1775
			$frame_receivedasid = ord(substr($parsedFrame['data'], $frame_offset++, 1));
1776
1777
			$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
1778
			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
1779
				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
1780
			}
1781
			$frame_sellername = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
1782
			if (ord($frame_sellername) === 0) {
1783
				$frame_sellername = '';
@@ 1788-1790 (lines=3) @@
1785
			$frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);
1786
1787
			$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
1788
			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
1789
				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
1790
			}
1791
			$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
1792
			if (ord($frame_description) === 0) {
1793
				$frame_description = '';