diff --git src/wp-includes/ID3/module.audio-video.quicktime.php src/wp-includes/ID3/module.audio-video.quicktime.php
index d6e0eda7dd..2082186d6d 100644
|
|
class getid3_quicktime extends getid3_handler |
207 | 207 | } |
208 | 208 | } |
209 | 209 | } |
210 | | if ($info['audio']['dataformat'] == 'mp4') { |
| 210 | if ($info['audio']['dataformat'] === 'mp4') { |
211 | 211 | $info['fileformat'] = 'mp4'; |
212 | 212 | if (empty($info['video']['resolution_x'])) { |
213 | 213 | $info['mime_type'] = 'audio/mp4'; |
… |
… |
class getid3_quicktime extends getid3_handler |
289 | 289 | // some "ilst" atoms contain data atoms that have a numeric name, and the data is far more accessible if the returned array is compacted |
290 | 290 | $allnumericnames = true; |
291 | 291 | foreach ($atom_structure['subatoms'] as $subatomarray) { |
292 | | if (!is_integer($subatomarray['name']) || (count($subatomarray['subatoms']) != 1)) { |
| 292 | if (!is_integer($subatomarray['name']) || (count($subatomarray['subatoms']) !== 1)) { |
293 | 293 | $allnumericnames = false; |
294 | 294 | break; |
295 | 295 | } |
… |
… |
$this->warning('incomplete/incorrect handling of "stsd" with Parrot metadata in |
949 | 949 | $atom_structure['sample_description_table'][$i]['video_pixel_color_type'] = (((int) $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] > 32) ? 'grayscale' : 'color'); |
950 | 950 | $atom_structure['sample_description_table'][$i]['video_pixel_color_name'] = $this->QuicktimeColorNameLookup($atom_structure['sample_description_table'][$i]['video_pixel_color_depth']); |
951 | 951 | |
952 | | if ($atom_structure['sample_description_table'][$i]['video_pixel_color_name'] != 'invalid') { |
| 952 | if ($atom_structure['sample_description_table'][$i]['video_pixel_color_name'] !== 'invalid') { |
953 | 953 | $info['quicktime']['video']['codec_fourcc'] = $atom_structure['sample_description_table'][$i]['data_format']; |
954 | 954 | $info['quicktime']['video']['codec_fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($atom_structure['sample_description_table'][$i]['data_format']); |
955 | 955 | $info['quicktime']['video']['codec'] = (((int) $atom_structure['sample_description_table'][$i]['video_encoder_name_len'] > 0) ? $atom_structure['sample_description_table'][$i]['video_encoder_name'] : $atom_structure['sample_description_table'][$i]['data_format']); |
… |
… |
$this->warning('incomplete/incorrect handling of "stsd" with Parrot metadata in |
2114 | 2114 | |
2115 | 2115 | $atom_structure['ES_DescrTag'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1)); |
2116 | 2116 | $esds_offset += 1; |
2117 | | if ($atom_structure['ES_DescrTag'] != 0x03) { |
| 2117 | if ($atom_structure['ES_DescrTag'] !== 0x03) { |
2118 | 2118 | $this->warning('expecting esds.ES_DescrTag = 0x03, found 0x'.getid3_lib::PrintHexBytes($atom_structure['ES_DescrTag']).'), at offset '.$atom_structure['offset']); |
2119 | 2119 | break; |
2120 | 2120 | } |
… |
… |
$this->warning('incomplete/incorrect handling of "stsd" with Parrot metadata in |
2143 | 2143 | |
2144 | 2144 | $atom_structure['ES_DecoderConfigDescrTag'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1)); |
2145 | 2145 | $esds_offset += 1; |
2146 | | if ($atom_structure['ES_DecoderConfigDescrTag'] != 0x04) { |
| 2146 | if ($atom_structure['ES_DecoderConfigDescrTag'] !== 0x04) { |
2147 | 2147 | $this->warning('expecting esds.ES_DecoderConfigDescrTag = 0x04, found 0x'.getid3_lib::PrintHexBytes($atom_structure['ES_DecoderConfigDescrTag']).'), at offset '.$atom_structure['offset']); |
2148 | 2148 | break; |
2149 | 2149 | } |
… |
… |
$this->warning('incomplete/incorrect handling of "stsd" with Parrot metadata in |
2174 | 2174 | |
2175 | 2175 | $atom_structure['ES_DecSpecificInfoTag'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1)); |
2176 | 2176 | $esds_offset += 1; |
2177 | | if ($atom_structure['ES_DecSpecificInfoTag'] != 0x05) { |
| 2177 | if ($atom_structure['ES_DecSpecificInfoTag'] !== 0x05) { |
2178 | 2178 | $this->warning('expecting esds.ES_DecSpecificInfoTag = 0x05, found 0x'.getid3_lib::PrintHexBytes($atom_structure['ES_DecSpecificInfoTag']).'), at offset '.$atom_structure['offset']); |
2179 | 2179 | break; |
2180 | 2180 | } |
… |
… |
$this->warning('incomplete/incorrect handling of "stsd" with Parrot metadata in |
2185 | 2185 | |
2186 | 2186 | $atom_structure['ES_SLConfigDescrTag'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1)); |
2187 | 2187 | $esds_offset += 1; |
2188 | | if ($atom_structure['ES_SLConfigDescrTag'] != 0x06) { |
| 2188 | if ($atom_structure['ES_SLConfigDescrTag'] !== 0x06) { |
2189 | 2189 | $this->warning('expecting esds.ES_SLConfigDescrTag = 0x05, found 0x'.getid3_lib::PrintHexBytes($atom_structure['ES_SLConfigDescrTag']).'), at offset '.$atom_structure['offset']); |
2190 | 2190 | break; |
2191 | 2191 | } |
… |
… |
$this->error('fragmented mp4 files not currently supported'); |
2918 | 2918 | } |
2919 | 2919 | $info = &$this->getid3->info; |
2920 | 2920 | $comment_key = ''; |
2921 | | if ($boxname && ($boxname != $keyname)) { |
| 2921 | if ($boxname && ($boxname !== $keyname)) { |
2922 | 2922 | $comment_key = (isset($handyatomtranslatorarray[$boxname]) ? $handyatomtranslatorarray[$boxname] : $boxname); |
2923 | 2923 | } elseif (isset($handyatomtranslatorarray[$keyname])) { |
2924 | 2924 | $comment_key = $handyatomtranslatorarray[$keyname]; |
2925 | 2925 | } |
2926 | 2926 | if ($comment_key) { |
2927 | | if ($comment_key == 'picture') { |
| 2927 | if ($comment_key === 'picture') { |
2928 | 2928 | // already copied directly into [comments][picture] elsewhere, do not re-copy here |
2929 | 2929 | return true; |
2930 | 2930 | } |
2931 | 2931 | $gooddata = array($data); |
2932 | | if ($comment_key == 'genre') { |
| 2932 | if ($comment_key === 'genre') { |
2933 | 2933 | // some other taggers separate multiple genres with semicolon, e.g. "Heavy Metal;Thrash Metal;Metal" |
2934 | 2934 | $gooddata = explode(';', $data); |
2935 | 2935 | } |
diff --git src/wp-includes/ID3/module.audio-video.riff.php src/wp-includes/ID3/module.audio-video.riff.php
index a94ae24d0c..c9b875f70b 100644
|
|
class getid3_riff extends getid3_handler |
82 | 82 | //$info['fileformat'] = 'riff'; |
83 | 83 | $this->container = 'riff'; |
84 | 84 | $thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize); |
85 | | if ($RIFFsubtype == 'RMP3') { |
| 85 | if ( 'RMP3' === $RIFFsubtype ) { |
86 | 86 | // RMP3 is identical to WAVE, just renamed. Used by [unknown program] when creating RIFF-MP3s |
87 | 87 | $RIFFsubtype = 'WAVE'; |
88 | 88 | } |
… |
… |
class getid3_riff extends getid3_handler |
1516 | 1516 | |
1517 | 1517 | // the rest is all hardcoded(?) and does not appear to be useful until you get to audio info at offset 256, even then everything is probably hardcoded |
1518 | 1518 | |
1519 | | if (substr($AMVheader, 68, 20) != 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x38\x00\x00\x00") { |
| 1519 | if (substr($AMVheader, 68, 20) !== 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x38\x00\x00\x00") { |
1520 | 1520 | throw new Exception('expecting "LIST<0x00000000>strlstrh<0x38000000>" at offset '.($startoffset + 68).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 68, 20)).'"'); |
1521 | 1521 | } |
1522 | 1522 | // followed by 56 bytes of null: substr($AMVheader, 88, 56) -> 144 |
1523 | | if (substr($AMVheader, 144, 8) != 'strf'."\x24\x00\x00\x00") { |
| 1523 | if (substr($AMVheader, 144, 8) !== 'strf'."\x24\x00\x00\x00") { |
1524 | 1524 | throw new Exception('expecting "strf<0x24000000>" at offset '.($startoffset + 144).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 144, 8)).'"'); |
1525 | 1525 | } |
1526 | 1526 | // followed by 36 bytes of null: substr($AMVheader, 144, 36) -> 180 |
1527 | 1527 | |
1528 | | if (substr($AMVheader, 188, 20) != 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x30\x00\x00\x00") { |
| 1528 | if (substr($AMVheader, 188, 20) !== 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x30\x00\x00\x00") { |
1529 | 1529 | throw new Exception('expecting "LIST<0x00000000>strlstrh<0x30000000>" at offset '.($startoffset + 188).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 188, 20)).'"'); |
1530 | 1530 | } |
1531 | 1531 | // followed by 48 bytes of null: substr($AMVheader, 208, 48) -> 256 |
1532 | | if (substr($AMVheader, 256, 8) != 'strf'."\x14\x00\x00\x00") { |
| 1532 | if (substr($AMVheader, 256, 8) !== 'strf'."\x14\x00\x00\x00") { |
1533 | 1533 | throw new Exception('expecting "strf<0x14000000>" at offset '.($startoffset + 256).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 256, 8)).'"'); |
1534 | 1534 | } |
1535 | 1535 | // followed by 20 bytes of a modified WAVEFORMATEX: |
… |
… |
class getid3_riff extends getid3_handler |
1601 | 1601 | $this->error('Expecting chunk name at offset '.($this->ftell() - 8).' but found nothing. Aborting RIFF parsing.'); |
1602 | 1602 | break; |
1603 | 1603 | } |
1604 | | if (($chunksize == 0) && ($chunkname != 'JUNK')) { |
| 1604 | if (($chunksize === 0) && ($chunkname !== 'JUNK')) { |
1605 | 1605 | $this->warning('Chunk ('.$chunkname.') size at offset '.($this->ftell() - 4).' is zero. Aborting RIFF parsing.'); |
1606 | 1606 | break; |
1607 | 1607 | } |
1608 | | if (($chunksize % 2) != 0) { |
| 1608 | if (($chunksize % 2) !== 0) { |
1609 | 1609 | // all structures are packed on word boundaries |
1610 | 1610 | $chunksize++; |
1611 | 1611 | } |
… |
… |
class getid3_riff extends getid3_handler |
1624 | 1624 | $AudioChunkStreamType = substr($AudioChunkHeader, 2, 2); |
1625 | 1625 | $AudioChunkSize = getid3_lib::LittleEndian2Int(substr($AudioChunkHeader, 4, 4)); |
1626 | 1626 | |
1627 | | if ($AudioChunkStreamType == 'wb') { |
| 1627 | if ($AudioChunkStreamType === 'wb') { |
1628 | 1628 | $FirstFourBytes = substr($AudioChunkHeader, 8, 4); |
1629 | 1629 | if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', $FirstFourBytes)) { |
1630 | 1630 | // MP3 |
… |
… |
class getid3_riff extends getid3_handler |
1815 | 1815 | if ($chunksize < 1048576) { |
1816 | 1816 | if ($chunksize > 0) { |
1817 | 1817 | $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize); |
1818 | | if ($chunkname == 'JUNK') { |
| 1818 | if ( 'JUNK' === $chunkname ) { |
1819 | 1819 | if (preg_match('#^([\\x20-\\x7F]+)#', $RIFFchunk[$chunkname][$thisindex]['data'], $matches)) { |
1820 | 1820 | // only keep text characters [chr(32)-chr(127)] |
1821 | 1821 | $info['riff']['comments']['junk'][] = trim($matches[1]); |
… |
… |
class getid3_riff extends getid3_handler |
1899 | 1899 | $info['riff']['comments'][$key] = array($RIFFchunk[$chunkname][$thisindex]['parsed'][$key]); |
1900 | 1900 | } |
1901 | 1901 | } |
1902 | | if ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] && !empty($info['filesize']) && ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] != $info['filesize'])) { |
| 1902 | if ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] && !empty($info['filesize']) && ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] !== $info['filesize'])) { |
1903 | 1903 | $this->warning('RIFF.WAVE.scot.filelength ('.$RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'].') different from actual filesize ('.$info['filesize'].')'); |
1904 | 1904 | } |
1905 | 1905 | break; |
diff --git src/wp-includes/ID3/module.audio.flac.php src/wp-includes/ID3/module.audio.flac.php
index 014061da94..f3f944344d 100644
|
|
class getid3_flac extends getid3_handler |
34 | 34 | |
35 | 35 | $this->fseek($info['avdataoffset']); |
36 | 36 | $StreamMarker = $this->fread(4); |
37 | | if ($StreamMarker != self::syncword) { |
| 37 | if ($StreamMarker !== self::syncword) { |
38 | 38 | return $this->error('Expecting "'.getid3_lib::PrintHexBytes(self::syncword).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($StreamMarker).'"'); |
39 | 39 | } |
40 | 40 | $info['fileformat'] = 'flac'; |
… |
… |
class getid3_flac extends getid3_handler |
65 | 65 | break; |
66 | 66 | } |
67 | 67 | if ($BlockLength < 1) { |
68 | | if ($BlockTypeText != 'reserved') { |
| 68 | if ($BlockTypeText !== 'reserved') { |
69 | 69 | // probably supposed to be zero-length |
70 | 70 | $this->warning('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockTypeText.') at offset '.$BlockOffset.' is zero bytes'); |
71 | 71 | continue; |