diff --git wp-includes/ID3/module.audio-video.asf.php wp-includes/ID3/module.audio-video.asf.php
index ee61d7d..4f96968 100644
|
|
|
class getid3_asf extends getid3_handler { |
| 266 | 266 | $offset += 16; |
| 267 | 267 | $thisfile_asf_headerextensionobject['reserved_1_guid'] = $this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']); |
| 268 | 268 | if ($thisfile_asf_headerextensionobject['reserved_1'] != GETID3_ASF_Reserved_1) { |
| 269 | | $info['warning'][] = 'header_extension_object.reserved_1 GUID ('.$this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']).') does not match expected "GETID3_ASF_Reserved_1" GUID ('.$this->BytestringToGUID(GETID3_ASF_Reserved_1).')'; |
| | 269 | $this->warning('header_extension_object.reserved_1 GUID ('.$this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']).') does not match expected "GETID3_ASF_Reserved_1" GUID ('.$this->BytestringToGUID(GETID3_ASF_Reserved_1).')'); |
| 270 | 270 | //return false; |
| 271 | 271 | break; |
| 272 | 272 | } |
| 273 | 273 | $thisfile_asf_headerextensionobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); |
| 274 | 274 | $offset += 2; |
| 275 | 275 | if ($thisfile_asf_headerextensionobject['reserved_2'] != 6) { |
| 276 | | $info['warning'][] = 'header_extension_object.reserved_2 ('.getid3_lib::PrintHexBytes($thisfile_asf_headerextensionobject['reserved_2']).') does not match expected value of "6"'; |
| | 276 | $this->warning('header_extension_object.reserved_2 ('.getid3_lib::PrintHexBytes($thisfile_asf_headerextensionobject['reserved_2']).') does not match expected value of "6"'); |
| 277 | 277 | //return false; |
| 278 | 278 | break; |
| 279 | 279 | } |
| … |
… |
class getid3_asf extends getid3_handler { |
| 316 | 316 | $offset += 16; |
| 317 | 317 | $thisfile_asf_codeclistobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']); |
| 318 | 318 | if ($thisfile_asf_codeclistobject['reserved'] != $this->GUIDtoBytestring('86D15241-311D-11D0-A3A4-00A0C90348F6')) { |
| 319 | | $info['warning'][] = 'codec_list_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {86D15241-311D-11D0-A3A4-00A0C90348F6}'; |
| | 319 | $this->warning('codec_list_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {86D15241-311D-11D0-A3A4-00A0C90348F6}'); |
| 320 | 320 | //return false; |
| 321 | 321 | break; |
| 322 | 322 | } |
| … |
… |
class getid3_asf extends getid3_handler { |
| 349 | 349 | if ($thisfile_asf_codeclistobject_codecentries_current['type_raw'] == 2) { // audio codec |
| 350 | 350 | |
| 351 | 351 | if (strpos($thisfile_asf_codeclistobject_codecentries_current['description'], ',') === false) { |
| 352 | | $info['warning'][] = '[asf][codec_list_object][codec_entries]['.$CodecEntryCounter.'][description] expected to contain comma-seperated list of parameters: "'.$thisfile_asf_codeclistobject_codecentries_current['description'].'"'; |
| | 352 | $this->warning('[asf][codec_list_object][codec_entries]['.$CodecEntryCounter.'][description] expected to contain comma-seperated list of parameters: "'.$thisfile_asf_codeclistobject_codecentries_current['description'].'"'); |
| 353 | 353 | } else { |
| 354 | 354 | |
| 355 | 355 | list($AudioCodecBitrate, $AudioCodecFrequency, $AudioCodecChannels) = explode(',', $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description'])); |
| … |
… |
class getid3_asf extends getid3_handler { |
| 412 | 412 | break; |
| 413 | 413 | |
| 414 | 414 | default: |
| 415 | | $info['warning'][] = 'unknown frequency: "'.$AudioCodecFrequency.'" ('.$this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']).')'; |
| | 415 | $this->warning('unknown frequency: "'.$AudioCodecFrequency.'" ('.$this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']).')'); |
| 416 | 416 | break; |
| 417 | 417 | } |
| 418 | 418 | |
| … |
… |
class getid3_asf extends getid3_handler { |
| 458 | 458 | $offset += 16; |
| 459 | 459 | $thisfile_asf_scriptcommandobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']); |
| 460 | 460 | if ($thisfile_asf_scriptcommandobject['reserved'] != $this->GUIDtoBytestring('4B1ACBE3-100B-11D0-A39B-00A0C90348F6')) { |
| 461 | | $info['warning'][] = 'script_command_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4B1ACBE3-100B-11D0-A39B-00A0C90348F6}'; |
| | 461 | $this->warning('script_command_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4B1ACBE3-100B-11D0-A39B-00A0C90348F6}'); |
| 462 | 462 | //return false; |
| 463 | 463 | break; |
| 464 | 464 | } |
| … |
… |
class getid3_asf extends getid3_handler { |
| 517 | 517 | $offset += 16; |
| 518 | 518 | $thisfile_asf_markerobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_markerobject['reserved']); |
| 519 | 519 | if ($thisfile_asf_markerobject['reserved'] != $this->GUIDtoBytestring('4CFEDB20-75F6-11CF-9C0F-00A0C90349CB')) { |
| 520 | | $info['warning'][] = 'marker_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_markerobject['reserved_1']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}'; |
| | 520 | $this->warning('marker_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_markerobject['reserved_1']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}'); |
| 521 | 521 | break; |
| 522 | 522 | } |
| 523 | 523 | $thisfile_asf_markerobject['markers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); |
| … |
… |
class getid3_asf extends getid3_handler { |
| 525 | 525 | $thisfile_asf_markerobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); |
| 526 | 526 | $offset += 2; |
| 527 | 527 | if ($thisfile_asf_markerobject['reserved_2'] != 0) { |
| 528 | | $info['warning'][] = 'marker_object.reserved_2 ('.getid3_lib::PrintHexBytes($thisfile_asf_markerobject['reserved_2']).') does not match expected value of "0"'; |
| | 528 | $this->warning('marker_object.reserved_2 ('.getid3_lib::PrintHexBytes($thisfile_asf_markerobject['reserved_2']).') does not match expected value of "0"'); |
| 529 | 529 | break; |
| 530 | 530 | } |
| 531 | 531 | $thisfile_asf_markerobject['name_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); |
| … |
… |
class getid3_asf extends getid3_handler { |
| 576 | 576 | $thisfile_asf_bitratemutualexclusionobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']); |
| 577 | 577 | $offset += 16; |
| 578 | 578 | if (($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Bitrate) && ($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Unknown)) { |
| 579 | | $info['warning'][] = 'bitrate_mutual_exclusion_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']).'} does not match expected "GETID3_ASF_Mutex_Bitrate" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Bitrate).'} or "GETID3_ASF_Mutex_Unknown" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Unknown).'}'; |
| | 579 | $this->warning('bitrate_mutual_exclusion_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']).'} does not match expected "GETID3_ASF_Mutex_Bitrate" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Bitrate).'} or "GETID3_ASF_Mutex_Unknown" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Unknown).'}'); |
| 580 | 580 | //return false; |
| 581 | 581 | break; |
| 582 | 582 | } |
| … |
… |
class getid3_asf extends getid3_handler { |
| 637 | 637 | break; |
| 638 | 638 | |
| 639 | 639 | default: |
| 640 | | $info['warning'][] = 'error_correction_object.error_correction_type GUID {'.$this->BytestringToGUID($thisfile_asf_errorcorrectionobject['reserved']).'} does not match expected "GETID3_ASF_No_Error_Correction" GUID {'.$this->BytestringToGUID(GETID3_ASF_No_Error_Correction).'} or "GETID3_ASF_Audio_Spread" GUID {'.$this->BytestringToGUID(GETID3_ASF_Audio_Spread).'}'; |
| | 640 | $this->warning('error_correction_object.error_correction_type GUID {'.$this->BytestringToGUID($thisfile_asf_errorcorrectionobject['reserved']).'} does not match expected "GETID3_ASF_No_Error_Correction" GUID {'.$this->BytestringToGUID(GETID3_ASF_No_Error_Correction).'} or "GETID3_ASF_Audio_Spread" GUID {'.$this->BytestringToGUID(GETID3_ASF_Audio_Spread).'}'); |
| 641 | 641 | //return false; |
| 642 | 642 | break; |
| 643 | 643 | } |
| … |
… |
class getid3_asf extends getid3_handler { |
| 761 | 761 | break; |
| 762 | 762 | |
| 763 | 763 | default: |
| 764 | | $info['warning'][] = 'extended_content_description.content_descriptors.'.$ExtendedContentDescriptorsCounter.'.value_type is invalid ('.$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type'].')'; |
| | 764 | $this->warning('extended_content_description.content_descriptors.'.$ExtendedContentDescriptorsCounter.'.value_type is invalid ('.$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type'].')'); |
| 765 | 765 | //return false; |
| 766 | 766 | break; |
| 767 | 767 | } |
| … |
… |
class getid3_asf extends getid3_handler { |
| 962 | 962 | default: |
| 963 | 963 | // Implementations shall ignore any standard or non-standard object that they do not know how to handle. |
| 964 | 964 | if ($this->GUIDname($NextObjectGUIDtext)) { |
| 965 | | $info['warning'][] = 'unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8); |
| | 965 | $this->warning('unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8)); |
| 966 | 966 | } else { |
| 967 | | $info['warning'][] = 'unknown GUID {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8); |
| | 967 | $this->warning('unknown GUID {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8)); |
| 968 | 968 | } |
| 969 | 969 | $offset += ($NextObjectSize - 16 - 8); |
| 970 | 970 | break; |
| … |
… |
class getid3_asf extends getid3_handler { |
| 1183 | 1183 | $thisfile_asf_dataobject['reserved'] = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 2)); |
| 1184 | 1184 | $offset += 2; |
| 1185 | 1185 | if ($thisfile_asf_dataobject['reserved'] != 0x0101) { |
| 1186 | | $info['warning'][] = 'data_object.reserved ('.getid3_lib::PrintHexBytes($thisfile_asf_dataobject['reserved']).') does not match expected value of "0x0101"'; |
| | 1186 | $this->warning('data_object.reserved ('.getid3_lib::PrintHexBytes($thisfile_asf_dataobject['reserved']).') does not match expected value of "0x0101"'); |
| 1187 | 1187 | //return false; |
| 1188 | 1188 | break; |
| 1189 | 1189 | } |
| … |
… |
class getid3_asf extends getid3_handler { |
| 1319 | 1319 | default: |
| 1320 | 1320 | // Implementations shall ignore any standard or non-standard object that they do not know how to handle. |
| 1321 | 1321 | if ($this->GUIDname($NextObjectGUIDtext)) { |
| 1322 | | $info['warning'][] = 'unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF body at offset '.($offset - 16 - 8); |
| | 1322 | $this->warning('unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF body at offset '.($offset - 16 - 8)); |
| 1323 | 1323 | } else { |
| 1324 | | $info['warning'][] = 'unknown GUID {'.$NextObjectGUIDtext.'} in ASF body at offset '.($this->ftell() - 16 - 8); |
| | 1324 | $this->warning('unknown GUID {'.$NextObjectGUIDtext.'} in ASF body at offset '.($this->ftell() - 16 - 8)); |
| 1325 | 1325 | } |
| 1326 | 1326 | $this->fseek(($NextObjectSize - 16 - 8), SEEK_CUR); |
| 1327 | 1327 | break; |
| … |
… |
class getid3_asf extends getid3_handler { |
| 1405 | 1405 | break; |
| 1406 | 1406 | |
| 1407 | 1407 | default: |
| 1408 | | $info['warning'][] = 'Unknown streamtype: [codec_list_object][codec_entries]['.$streamnumber.'][type_raw] == '.$streamdata['type_raw']; |
| | 1408 | $this->warning('Unknown streamtype: [codec_list_object][codec_entries]['.$streamnumber.'][type_raw] == '.$streamdata['type_raw']); |
| 1409 | 1409 | break; |
| 1410 | 1410 | |
| 1411 | 1411 | } |
diff --git wp-includes/ID3/module.audio-video.flv.php wp-includes/ID3/module.audio-video.flv.php
index c5fbd4b..7156161 100644
|
|
|
class getid3_flv extends getid3_handler { |
| 93 | 93 | $TypeFlags = getid3_lib::BigEndian2Int(substr($FLVheader, 4, 1)); |
| 94 | 94 | |
| 95 | 95 | if ($info['flv']['header']['signature'] != self::magic) { |
| 96 | | $info['error'][] = 'Expecting "'.getid3_lib::PrintHexBytes(self::magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['flv']['header']['signature']).'"'; |
| | 96 | $this->error('Expecting "'.getid3_lib::PrintHexBytes(self::magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['flv']['header']['signature']).'"'); |
| 97 | 97 | unset($info['flv'], $info['fileformat']); |
| 98 | 98 | return false; |
| 99 | 99 | } |
diff --git wp-includes/ID3/module.audio-video.matroska.php wp-includes/ID3/module.audio-video.matroska.php
index f2cc5ac..2c025c7 100644
|
|
|
class getid3_matroska extends getid3_handler |
| 234 | 234 | try { |
| 235 | 235 | $this->parseEBML($info); |
| 236 | 236 | } catch (Exception $e) { |
| 237 | | $info['error'][] = 'EBML parser: '.$e->getMessage(); |
| | 237 | $this->error('EBML parser: '.$e->getMessage()); |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | // calculate playtime |
diff --git wp-includes/ID3/module.audio-video.quicktime.php wp-includes/ID3/module.audio-video.quicktime.php
index 482c091..34bf568 100644
|
|
|
class getid3_quicktime extends getid3_handler |
| 38 | 38 | $atom_data_read_buffer_size = ($info['php_memory_limit'] ? round($info['php_memory_limit'] / 2) : $this->getid3->option_fread_buffer_size * 1024); // allow [default: 32MB] if PHP configured with no memory_limit |
| 39 | 39 | while ($offset < $info['avdataend']) { |
| 40 | 40 | if (!getid3_lib::intValueSupported($offset)) { |
| 41 | | $info['error'][] = 'Unable to parse atom at offset '.$offset.' because beyond '.round(PHP_INT_MAX / 1073741824).'GB limit of PHP filesystem functions'; |
| | 41 | $this->error('Unable to parse atom at offset '.$offset.' because beyond '.round(PHP_INT_MAX / 1073741824).'GB limit of PHP filesystem functions'); |
| 42 | 42 | break; |
| 43 | 43 | } |
| 44 | 44 | $this->fseek($offset); |
| … |
… |
class getid3_quicktime extends getid3_handler |
| 57 | 57 | $info['quicktime'][$atomname]['offset'] = $offset; |
| 58 | 58 | |
| 59 | 59 | if (($offset + $atomsize) > $info['avdataend']) { |
| 60 | | $info['error'][] = 'Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atomsize.' bytes)'; |
| | 60 | $this->error('Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atomsize.' bytes)'); |
| 61 | 61 | return false; |
| 62 | 62 | } |
| 63 | 63 | |
| … |
… |
class getid3_quicktime extends getid3_handler |
| 318 | 318 | $boxsmalltype = substr($atom_data, $atomoffset + 2, 2); |
| 319 | 319 | $boxsmalldata = substr($atom_data, $atomoffset + 4, $boxsmallsize); |
| 320 | 320 | if ($boxsmallsize <= 1) { |
| 321 | | $info['warning'][] = 'Invalid QuickTime atom smallbox size "'.$boxsmallsize.'" in atom "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" at offset: '.($atom_structure['offset'] + $atomoffset); |
| | 321 | $this->warning('Invalid QuickTime atom smallbox size "'.$boxsmallsize.'" in atom "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" at offset: '.($atom_structure['offset'] + $atomoffset)); |
| 322 | 322 | $atom_structure['data'] = null; |
| 323 | 323 | $atomoffset = strlen($atom_data); |
| 324 | 324 | break; |
| … |
… |
class getid3_quicktime extends getid3_handler |
| 328 | 328 | $atom_structure['data'] = $boxsmalldata; |
| 329 | 329 | break; |
| 330 | 330 | default: |
| 331 | | $info['warning'][] = 'Unknown QuickTime smallbox type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $boxsmalltype).'" ('.trim(getid3_lib::PrintHexBytes($boxsmalltype)).') at offset '.$baseoffset; |
| | 331 | $this->warning('Unknown QuickTime smallbox type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $boxsmalltype).'" ('.trim(getid3_lib::PrintHexBytes($boxsmalltype)).') at offset '.$baseoffset); |
| 332 | 332 | $atom_structure['data'] = $atom_data; |
| 333 | 333 | break; |
| 334 | 334 | } |
| … |
… |
class getid3_quicktime extends getid3_handler |
| 340 | 340 | $boxtype = substr($atom_data, $atomoffset + 4, 4); |
| 341 | 341 | $boxdata = substr($atom_data, $atomoffset + 8, $boxsize - 8); |
| 342 | 342 | if ($boxsize <= 1) { |
| 343 | | $info['warning'][] = 'Invalid QuickTime atom box size "'.$boxsize.'" in atom "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" at offset: '.($atom_structure['offset'] + $atomoffset); |
| | 343 | $this->warning('Invalid QuickTime atom box size "'.$boxsize.'" in atom "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" at offset: '.($atom_structure['offset'] + $atomoffset)); |
| 344 | 344 | $atom_structure['data'] = null; |
| 345 | 345 | $atomoffset = strlen($atom_data); |
| 346 | 346 | break; |
| … |
… |
class getid3_quicktime extends getid3_handler |
| 428 | 428 | break; |
| 429 | 429 | |
| 430 | 430 | default: |
| 431 | | $info['warning'][] = 'Unknown QuickTime box type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $boxtype).'" ('.trim(getid3_lib::PrintHexBytes($boxtype)).') at offset '.$baseoffset; |
| | 431 | $this->warning('Unknown QuickTime box type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $boxtype).'" ('.trim(getid3_lib::PrintHexBytes($boxtype)).') at offset '.$baseoffset); |
| 432 | 432 | $atom_structure['data'] = $atom_data; |
| 433 | 433 | |
| 434 | 434 | } |
| … |
… |
class getid3_quicktime extends getid3_handler |
| 476 | 476 | if ($UncompressedHeader = @gzuncompress($CompressedFileData)) { |
| 477 | 477 | $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($UncompressedHeader, 0, $atomHierarchy, $ParseAllPossibleAtoms); |
| 478 | 478 | } else { |
| 479 | | $info['warning'][] = 'Error decompressing compressed MOV atom at offset '.$atom_structure['offset']; |
| | 479 | $this->warning('Error decompressing compressed MOV atom at offset '.$atom_structure['offset']); |
| 480 | 480 | } |
| 481 | 481 | break; |
| 482 | 482 | |
| … |
… |
class getid3_quicktime extends getid3_handler |
| 595 | 595 | if (isset($ptv_lookup[$atom_structure['display_size_raw']])) { |
| 596 | 596 | $atom_structure['display_size'] = $ptv_lookup[$atom_structure['display_size_raw']]; |
| 597 | 597 | } else { |
| 598 | | $info['warning'][] = 'unknown "ptv " display constant ('.$atom_structure['display_size_raw'].')'; |
| | 598 | $this->warning('unknown "ptv " display constant ('.$atom_structure['display_size_raw'].')'); |
| 599 | 599 | } |
| 600 | 600 | break; |
| 601 | 601 | |
| … |
… |
if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($ |
| 801 | 801 | |
| 802 | 802 | $max_stts_entries_to_scan = ($info['php_memory_limit'] ? min(floor($this->getid3->memory_limit / 10000), $atom_structure['number_entries']) : $atom_structure['number_entries']); |
| 803 | 803 | if ($max_stts_entries_to_scan < $atom_structure['number_entries']) { |
| 804 | | $info['warning'][] = 'QuickTime atom "stts" has '.$atom_structure['number_entries'].' but only scanning the first '.$max_stts_entries_to_scan.' entries due to limited PHP memory available ('.floor($atom_structure['number_entries'] / 1048576).'MB).'; |
| | 804 | $this->warning('QuickTime atom "stts" has '.$atom_structure['number_entries'].' but only scanning the first '.$max_stts_entries_to_scan.' entries due to limited PHP memory available ('.floor($atom_structure['number_entries'] / 1048576).'MB).'); |
| 805 | 805 | } |
| 806 | 806 | for ($i = 0; $i < $max_stts_entries_to_scan; $i++) { |
| 807 | 807 | $atom_structure['time_to_sample_table'][$i]['sample_count'] = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4)); |
| … |
… |
if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($ |
| 1001 | 1001 | $atom_structure['quality'] = getid3_lib::BigEndian2Int(substr($atom_data, 22, 2)); |
| 1002 | 1002 | |
| 1003 | 1003 | if ($atom_structure['time_scale'] == 0) { |
| 1004 | | $info['error'][] = 'Corrupt Quicktime file: mdhd.time_scale == zero'; |
| | 1004 | $this->error('Corrupt Quicktime file: mdhd.time_scale == zero'); |
| 1005 | 1005 | return false; |
| 1006 | 1006 | } |
| 1007 | 1007 | $info['quicktime']['time_scale'] = (isset($info['quicktime']['time_scale']) ? max($info['quicktime']['time_scale'], $atom_structure['time_scale']) : $atom_structure['time_scale']); |
| … |
… |
if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($ |
| 1115 | 1115 | $atom_structure['next_track_id'] = getid3_lib::BigEndian2Int(substr($atom_data, 96, 4)); |
| 1116 | 1116 | |
| 1117 | 1117 | if ($atom_structure['time_scale'] == 0) { |
| 1118 | | $info['error'][] = 'Corrupt Quicktime file: mvhd.time_scale == zero'; |
| | 1118 | $this->error('Corrupt Quicktime file: mvhd.time_scale == zero'); |
| 1119 | 1119 | return false; |
| 1120 | 1120 | } |
| 1121 | 1121 | $atom_structure['creation_time_unix'] = getid3_lib::DateMac2Unix($atom_structure['creation_time']); |
| … |
… |
if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($ |
| 1265 | 1265 | $getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false); |
| 1266 | 1266 | if (!empty($getid3_temp->info['warning'])) { |
| 1267 | 1267 | foreach ($getid3_temp->info['warning'] as $value) { |
| 1268 | | $info['warning'][] = $value; |
| | 1268 | $this->warning($value); |
| 1269 | 1269 | } |
| 1270 | 1270 | } |
| 1271 | 1271 | if (!empty($getid3_temp->info['mpeg'])) { |
| … |
… |
if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($ |
| 1368 | 1368 | $info['quicktime']['comments']['gps_altitude'][] = floatval($altitude); |
| 1369 | 1369 | } |
| 1370 | 1370 | } else { |
| 1371 | | $info['warning'][] = 'QuickTime atom "©xyz" data does not match expected data pattern at offset '.$baseoffset.'. Please report as getID3() bug.'; |
| | 1371 | $this->warning('QuickTime atom "©xyz" data does not match expected data pattern at offset '.$baseoffset.'. Please report as getID3() bug.'); |
| 1372 | 1372 | } |
| 1373 | 1373 | break; |
| 1374 | 1374 | |
| … |
… |
if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($ |
| 1416 | 1416 | break; |
| 1417 | 1417 | |
| 1418 | 1418 | default: |
| 1419 | | $info['warning'][] = 'Unknown QuickTime atom type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" ('.trim(getid3_lib::PrintHexBytes($atomname)).') at offset '.$baseoffset; |
| | 1419 | $this->warning('Unknown QuickTime atom type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" ('.trim(getid3_lib::PrintHexBytes($atomname)).') at offset '.$baseoffset); |
| 1420 | 1420 | $atom_structure['data'] = $atom_data; |
| 1421 | 1421 | break; |
| 1422 | 1422 | } |
diff --git wp-includes/ID3/module.audio-video.riff.php wp-includes/ID3/module.audio-video.riff.php
index e8ba944..88c946d 100644
|
|
|
class getid3_riff extends getid3_handler { |
| 190 | 190 | $thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($thisfile_riff_WAVE['fmt '][0]['data']); |
| 191 | 191 | $thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag']; |
| 192 | 192 | if (!isset($thisfile_riff_audio[$streamindex]['bitrate']) || ($thisfile_riff_audio[$streamindex]['bitrate'] == 0)) { |
| 193 | | $info['error'][] = 'Corrupt RIFF file: bitrate_audio == zero'; |
| | 193 | $this->error('Corrupt RIFF file: bitrate_audio == zero'); |
| 194 | 194 | return false; |
| 195 | 195 | } |
| 196 | 196 | $thisfile_riff_raw['fmt '] = $thisfile_riff_audio[$streamindex]['raw']; |
| … |
… |
class getid3_riff extends getid3_handler { |
| 199 | 199 | |
| 200 | 200 | $thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]); |
| 201 | 201 | if (substr($thisfile_audio['codec'], 0, strlen('unknown: 0x')) == 'unknown: 0x') { |
| 202 | | $info['warning'][] = 'Audio codec = '.$thisfile_audio['codec']; |
| | 202 | $this->warning('Audio codec = '.$thisfile_audio['codec']); |
| 203 | 203 | } |
| 204 | 204 | $thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate']; |
| 205 | 205 | |
| … |
… |
class getid3_riff extends getid3_handler { |
| 302 | 302 | list($dummy, $bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second']) = $matches_bext_time; |
| 303 | 303 | $thisfile_riff_WAVE_bext_0['origin_date_unix'] = gmmktime($bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second'], $bext_timestamp['month'], $bext_timestamp['day'], $bext_timestamp['year']); |
| 304 | 304 | } else { |
| 305 | | $info['warning'][] = 'RIFF.WAVE.BEXT.origin_time is invalid'; |
| | 305 | $this->warning('RIFF.WAVE.BEXT.origin_time is invalid'); |
| 306 | 306 | } |
| 307 | 307 | } else { |
| 308 | | $info['warning'][] = 'RIFF.WAVE.BEXT.origin_date is invalid'; |
| | 308 | $this->warning('RIFF.WAVE.BEXT.origin_date is invalid'); |
| 309 | 309 | } |
| 310 | 310 | $thisfile_riff['comments']['author'][] = $thisfile_riff_WAVE_bext_0['author']; |
| 311 | 311 | $thisfile_riff['comments']['title'][] = $thisfile_riff_WAVE_bext_0['title']; |
| … |
… |
class getid3_riff extends getid3_handler { |
| 385 | 385 | $SNDM_thisTagOffset += $SNDM_thisTagDataSize; |
| 386 | 386 | |
| 387 | 387 | if ($SNDM_thisTagSize != (4 + 4 + 2 + 2 + $SNDM_thisTagDataSize)) { |
| 388 | | $info['warning'][] = 'RIFF.WAVE.SNDM.data contains tag not expected length (expected: '.$SNDM_thisTagSize.', found: '.(4 + 4 + 2 + 2 + $SNDM_thisTagDataSize).') at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'; |
| | 388 | $this->warning('RIFF.WAVE.SNDM.data contains tag not expected length (expected: '.$SNDM_thisTagSize.', found: '.(4 + 4 + 2 + 2 + $SNDM_thisTagDataSize).') at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); |
| 389 | 389 | break; |
| 390 | 390 | } elseif ($SNDM_thisTagSize <= 0) { |
| 391 | | $info['warning'][] = 'RIFF.WAVE.SNDM.data contains zero-size tag at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'; |
| | 391 | $this->warning('RIFF.WAVE.SNDM.data contains zero-size tag at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); |
| 392 | 392 | break; |
| 393 | 393 | } |
| 394 | 394 | $SNDM_startoffset += $SNDM_thisTagSize; |
| … |
… |
class getid3_riff extends getid3_handler { |
| 397 | 397 | if ($parsedkey = self::waveSNDMtagLookup($SNDM_thisTagKey)) { |
| 398 | 398 | $thisfile_riff_WAVE_SNDM_0['parsed'][$parsedkey] = $SNDM_thisTagDataText; |
| 399 | 399 | } else { |
| 400 | | $info['warning'][] = 'RIFF.WAVE.SNDM contains unknown tag "'.$SNDM_thisTagKey.'" at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'; |
| | 400 | $this->warning('RIFF.WAVE.SNDM contains unknown tag "'.$SNDM_thisTagKey.'" at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); |
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | |
| … |
… |
class getid3_riff extends getid3_handler { |
| 570 | 570 | // byte, in which case - skip warning |
| 571 | 571 | } else { |
| 572 | 572 | // Short by more than one byte, throw warning |
| 573 | | $info['warning'][] = 'Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'; |
| | 573 | $this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); |
| 574 | 574 | $info['avdataend'] = $info['filesize']; |
| 575 | 575 | } |
| 576 | 576 | break; |
| … |
… |
class getid3_riff extends getid3_handler { |
| 579 | 579 | if ((($info['avdataend'] - $info['filesize']) == 1) && (($thisfile_riff[$RIFFsubtype]['data'][0]['size'] % 2) == 0) && ((($info['filesize'] - $info['avdataoffset']) % 2) == 1)) { |
| 580 | 580 | // output file appears to be incorrectly *not* padded to nearest WORD boundary |
| 581 | 581 | // Output less severe warning |
| 582 | | $info['warning'][] = 'File should probably be padded to nearest WORD boundary, but it is not (expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' therefore short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'; |
| | 582 | $this->warning('File should probably be padded to nearest WORD boundary, but it is not (expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' therefore short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); |
| 583 | 583 | $info['avdataend'] = $info['filesize']; |
| 584 | 584 | } else { |
| 585 | 585 | // Short by more than one byte, throw warning |
| 586 | | $info['warning'][] = 'Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'; |
| | 586 | $this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); |
| 587 | 587 | $info['avdataend'] = $info['filesize']; |
| 588 | 588 | } |
| 589 | 589 | break; |
| … |
… |
class getid3_riff extends getid3_handler { |
| 592 | 592 | if (!empty($info['mpeg']['audio']['LAME']['audio_bytes'])) { |
| 593 | 593 | if ((($info['avdataend'] - $info['avdataoffset']) - $info['mpeg']['audio']['LAME']['audio_bytes']) == 1) { |
| 594 | 594 | $info['avdataend']--; |
| 595 | | $info['warning'][] = 'Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'; |
| | 595 | $this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'); |
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | 598 | if (isset($thisfile_audio_dataformat) && ($thisfile_audio_dataformat == 'ac3')) { |
| … |
… |
class getid3_riff extends getid3_handler { |
| 619 | 619 | $info['avdataend'] = $thisfile_riff['AVI ']['movi']['offset'] + $thisfile_riff['AVI ']['movi']['size']; |
| 620 | 620 | } |
| 621 | 621 | if ($info['avdataend'] > $info['filesize']) { |
| 622 | | $info['warning'][] = 'Probably truncated file - expecting '.($info['avdataend'] - $info['avdataoffset']).' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($info['avdataend'] - $info['filesize']).' bytes)'; |
| | 622 | $this->warning('Probably truncated file - expecting '.($info['avdataend'] - $info['avdataoffset']).' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($info['avdataend'] - $info['filesize']).' bytes)'); |
| 623 | 623 | $info['avdataend'] = $info['filesize']; |
| 624 | 624 | } |
| 625 | 625 | } |
| … |
… |
class getid3_riff extends getid3_handler { |
| 660 | 660 | |
| 661 | 661 | $thisfile_riff_raw_avih['dwMicroSecPerFrame'] = $this->EitherEndian2Int(substr($avihData, 0, 4)); // frame display rate (or 0L) |
| 662 | 662 | if ($thisfile_riff_raw_avih['dwMicroSecPerFrame'] == 0) { |
| 663 | | $info['error'][] = 'Corrupt RIFF file: avih.dwMicroSecPerFrame == zero'; |
| | 663 | $this->error('Corrupt RIFF file: avih.dwMicroSecPerFrame == zero'); |
| 664 | 664 | return false; |
| 665 | 665 | } |
| 666 | 666 | |
| … |
… |
class getid3_riff extends getid3_handler { |
| 858 | 858 | break; |
| 859 | 859 | |
| 860 | 860 | default: |
| 861 | | $info['warning'][] = 'Unhandled fccType for stream ('.$i.'): "'.$strhfccType.'"'; |
| | 861 | $this->warning('Unhandled fccType for stream ('.$i.'): "'.$strhfccType.'"'); |
| 862 | 862 | break; |
| 863 | 863 | |
| 864 | 864 | } |
| … |
… |
class getid3_riff extends getid3_handler { |
| 963 | 963 | // structures rounded to 2-byte boundary, but dumb encoders |
| 964 | 964 | // forget to pad end of file to make this actually work |
| 965 | 965 | } else { |
| 966 | | $info['warning'][] = 'Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['SSND'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found'; |
| | 966 | $this->warning('Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['SSND'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found'); |
| 967 | 967 | } |
| 968 | 968 | $info['avdataend'] = $info['filesize']; |
| 969 | 969 | } |
| … |
… |
class getid3_riff extends getid3_handler { |
| 1020 | 1020 | } |
| 1021 | 1021 | $thisfile_audio['sample_rate'] = $thisfile_riff_audio['sample_rate']; |
| 1022 | 1022 | if ($thisfile_audio['sample_rate'] == 0) { |
| 1023 | | $info['error'][] = 'Corrupted AIFF file: sample_rate == zero'; |
| | 1023 | $this->error('Corrupted AIFF file: sample_rate == zero'); |
| 1024 | 1024 | return false; |
| 1025 | 1025 | } |
| 1026 | 1026 | $info['playtime_seconds'] = $thisfile_riff_audio['total_samples'] / $thisfile_audio['sample_rate']; |
| … |
… |
class getid3_riff extends getid3_handler { |
| 1080 | 1080 | $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'] + 8; |
| 1081 | 1081 | $info['avdataend'] = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['BODY'][0]['size']; |
| 1082 | 1082 | if ($info['avdataend'] > $info['filesize']) { |
| 1083 | | $info['warning'][] = 'Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['BODY'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found'; |
| | 1083 | $this->warning('Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['BODY'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found'); |
| 1084 | 1084 | } |
| 1085 | 1085 | } |
| 1086 | 1086 | |
| … |
… |
class getid3_riff extends getid3_handler { |
| 1112 | 1112 | break; |
| 1113 | 1113 | |
| 1114 | 1114 | default: |
| 1115 | | $info['warning'][] = 'Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found "'.sCompression.'"'; |
| | 1115 | $this->warning('Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found "'.sCompression.'"'); |
| 1116 | 1116 | break; |
| 1117 | 1117 | } |
| 1118 | 1118 | } |
| … |
… |
class getid3_riff extends getid3_handler { |
| 1130 | 1130 | break; |
| 1131 | 1131 | |
| 1132 | 1132 | default: |
| 1133 | | $info['warning'][] = 'Unexpected value in 8SVX.CHAN chunk - expecting 2 or 4 or 6, found "'.$ChannelsIndex.'"'; |
| | 1133 | $this->warning('Unexpected value in 8SVX.CHAN chunk - expecting 2 or 4 or 6, found "'.$ChannelsIndex.'"'); |
| 1134 | 1134 | break; |
| 1135 | 1135 | } |
| 1136 | 1136 | |
| … |
… |
class getid3_riff extends getid3_handler { |
| 1172 | 1172 | |
| 1173 | 1173 | |
| 1174 | 1174 | default: |
| 1175 | | $info['error'][] = 'Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA), found "'.$RIFFsubtype.'" instead'; |
| | 1175 | $this->error('Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA), found "'.$RIFFsubtype.'" instead'); |
| 1176 | 1176 | //unset($info['fileformat']); |
| 1177 | 1177 | } |
| 1178 | 1178 | |
| … |
… |
class getid3_riff extends getid3_handler { |
| 1185 | 1185 | foreach ($ID3v2_keys_bad as $ID3v2_key_bad) { |
| 1186 | 1186 | if (isset($thisfile_riff[$RIFFsubtype][$ID3v2_key_bad]) && !array_key_exists($ID3v2_key_good, $thisfile_riff[$RIFFsubtype])) { |
| 1187 | 1187 | $thisfile_riff[$RIFFsubtype][$ID3v2_key_good] = $thisfile_riff[$RIFFsubtype][$ID3v2_key_bad]; |
| 1188 | | $info['warning'][] = 'mapping "'.$ID3v2_key_bad.'" chunk to "'.$ID3v2_key_good.'"'; |
| | 1188 | $this->warning('mapping "'.$ID3v2_key_bad.'" chunk to "'.$ID3v2_key_good.'"'); |
| 1189 | 1189 | } |
| 1190 | 1190 | } |
| 1191 | 1191 | |
| … |
… |
class getid3_riff extends getid3_handler { |
| 1509 | 1509 | $info['ac3'] = $getid3_temp->info['ac3']; |
| 1510 | 1510 | if (!empty($getid3_temp->info['warning'])) { |
| 1511 | 1511 | foreach ($getid3_temp->info['warning'] as $key => $value) { |
| 1512 | | $info['warning'][] = $value; |
| | 1512 | $this->warning($value); |
| 1513 | 1513 | } |
| 1514 | 1514 | } |
| 1515 | 1515 | } |
diff --git wp-includes/ID3/module.audio.mp3.php wp-includes/ID3/module.audio.mp3.php
index 329f7a6..435261c 100644
|
|
|
class getid3_mp3 extends getid3_handler |
| 34 | 34 | |
| 35 | 35 | if (!$this->getOnlyMPEGaudioInfo($info['avdataoffset'])) { |
| 36 | 36 | if ($this->allow_bruteforce) { |
| 37 | | $info['error'][] = 'Rescanning file in BruteForce mode'; |
| | 37 | $this->error('Rescanning file in BruteForce mode'); |
| 38 | 38 | $this->getOnlyMPEGaudioInfoBruteForce($this->getid3->fp, $info); |
| 39 | 39 | } |
| 40 | 40 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | } |
| 75 | | $info['warning'][] = $synchoffsetwarning; |
| | 75 | $this->warning($synchoffsetwarning); |
| 76 | 76 | |
| 77 | 77 | } |
| 78 | 78 | |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 134 | 134 | break; |
| 135 | 135 | |
| 136 | 136 | default: |
| 137 | | $info['warning'][] = 'Expecting [audio][dataformat] to be mp1/mp2/mp3 when fileformat == mp3, [audio][dataformat] actually "'.$info['audio']['dataformat'].'"'; |
| | 137 | $this->warning('Expecting [audio][dataformat] to be mp1/mp2/mp3 when fileformat == mp3, [audio][dataformat] actually "'.$info['audio']['dataformat'].'"'); |
| 138 | 138 | break; |
| 139 | 139 | } |
| 140 | 140 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | if ($this->fseek($offset) != 0) { |
| 427 | | $info['error'][] = 'decodeMPEGaudioHeader() failed to seek to next offset at '.$offset; |
| | 427 | $this->error('decodeMPEGaudioHeader() failed to seek to next offset at '.$offset); |
| 428 | 428 | return false; |
| 429 | 429 | } |
| 430 | 430 | //$headerstring = $this->fread(1441); // worst-case max length = 32kHz @ 320kbps layer 3 = 1441 bytes/frame |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 462 | 462 | if ($MPEGaudioHeaderValidCache[$head4]) { |
| 463 | 463 | $thisfile_mpeg_audio['raw'] = $MPEGheaderRawArray; |
| 464 | 464 | } else { |
| 465 | | $info['error'][] = 'Invalid MPEG audio header ('.getid3_lib::PrintHexBytes($head4).') at offset '.$offset; |
| | 465 | $$this->error('Invalid MPEG audio header ('.getid3_lib::PrintHexBytes($head4).') at offset '.$offset); |
| 466 | 466 | return false; |
| 467 | 467 | } |
| 468 | 468 | |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 490 | 490 | |
| 491 | 491 | if ($thisfile_mpeg_audio['raw']['bitrate'] == 15) { |
| 492 | 492 | // http://www.hydrogenaudio.org/?act=ST&f=16&t=9682&st=0 |
| 493 | | $info['warning'][] = 'Invalid bitrate index (15), this is a known bug in free-format MP3s encoded by LAME v3.90 - 3.93.1'; |
| | 493 | $this->warning('Invalid bitrate index (15), this is a known bug in free-format MP3s encoded by LAME v3.90 - 3.93.1'); |
| 494 | 494 | $thisfile_mpeg_audio['raw']['bitrate'] = 0; |
| 495 | 495 | } |
| 496 | 496 | $thisfile_mpeg_audio['padding'] = (bool) $thisfile_mpeg_audio['raw']['padding']; |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 512 | 512 | if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] <= 192000)) { |
| 513 | 513 | // these are ok |
| 514 | 514 | } else { |
| 515 | | $info['error'][] = $thisfile_mpeg_audio['bitrate'].'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.'; |
| | 515 | $this->error($thisfile_mpeg_audio['bitrate'].'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.'); |
| 516 | 516 | return false; |
| 517 | 517 | } |
| 518 | 518 | break; |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 523 | 523 | if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] == 64000) || ($thisfile_mpeg_audio['bitrate'] >= 96000)) { |
| 524 | 524 | // these are ok |
| 525 | 525 | } else { |
| 526 | | $info['error'][] = intval(round($thisfile_mpeg_audio['bitrate'] / 1000)).'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.'; |
| | 526 | $this->error(intval(round($thisfile_mpeg_audio['bitrate'] / 1000)).'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.'); |
| 527 | 527 | return false; |
| 528 | 528 | } |
| 529 | 529 | break; |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 545 | 545 | if (isset($thisfile_mpeg_audio['framelength'])) { |
| 546 | 546 | $nextframetestoffset = $offset + $thisfile_mpeg_audio['framelength']; |
| 547 | 547 | } else { |
| 548 | | $info['error'][] = 'Frame at offset('.$offset.') is has an invalid frame length.'; |
| | 548 | $this->error('Frame at offset('.$offset.') is has an invalid frame length.'); |
| 549 | 549 | return false; |
| 550 | 550 | } |
| 551 | 551 | |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 837 | 837 | $thisfile_mpeg_audio_lame['preset_used_id'] = ($PresetSurroundBytes & 0x07FF); |
| 838 | 838 | $thisfile_mpeg_audio_lame['preset_used'] = self::LAMEpresetUsedLookup($thisfile_mpeg_audio_lame); |
| 839 | 839 | if (!empty($thisfile_mpeg_audio_lame['preset_used_id']) && empty($thisfile_mpeg_audio_lame['preset_used'])) { |
| 840 | | $info['warning'][] = 'Unknown LAME preset used ('.$thisfile_mpeg_audio_lame['preset_used_id'].') - please report to info@getid3.org'; |
| | 840 | $this->warning('Unknown LAME preset used ('.$thisfile_mpeg_audio_lame['preset_used_id'].') - please report to info@getid3.org'); |
| 841 | 841 | } |
| 842 | 842 | if (($thisfile_mpeg_audio_lame['short_version'] == 'LAME3.90.') && !empty($thisfile_mpeg_audio_lame['preset_used_id'])) { |
| 843 | 843 | // this may change if 3.90.4 ever comes out |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 881 | 881 | $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; |
| 882 | 882 | } |
| 883 | 883 | if ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') { |
| 884 | | $info['warning'][] = 'VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.'; |
| | 884 | $this->warning('VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.'); |
| 885 | 885 | } |
| 886 | 886 | } |
| 887 | 887 | |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 908 | 908 | // $this->fseek($prenullbytefileoffset); |
| 909 | 909 | // if ($PossibleNullByte === "\x00") { |
| 910 | 910 | $info['avdataend']--; |
| 911 | | // $info['warning'][] = 'Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'; |
| | 911 | // $this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'); |
| 912 | 912 | // } else { |
| 913 | | // $info['warning'][] = 'Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'; |
| | 913 | // $this->warning('Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'); |
| 914 | 914 | // } |
| 915 | 915 | } else { |
| 916 | | $info['warning'][] = 'Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'; |
| | 916 | $this->warning('Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'); |
| 917 | 917 | } |
| 918 | 918 | } |
| 919 | 919 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 931 | 931 | $info['audio']['bitrate'] = (($framebytelength - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144; |
| 932 | 932 | } |
| 933 | 933 | } else { |
| 934 | | $info['error'][] = 'Error calculating frame length of free-format MP3 without Xing/LAME header'; |
| | 934 | $this->error('Error calculating frame length of free-format MP3 without Xing/LAME header'); |
| 935 | 935 | } |
| 936 | 936 | } |
| 937 | 937 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1098 | 1098 | if (isset($nextframetestarray['mpeg']['audio']['framelength']) && ($nextframetestarray['mpeg']['audio']['framelength'] > 0)) { |
| 1099 | 1099 | $nextframetestoffset += $nextframetestarray['mpeg']['audio']['framelength']; |
| 1100 | 1100 | } else { |
| 1101 | | $info['error'][] = 'Frame at offset ('.$offset.') is has an invalid frame length.'; |
| | 1101 | $this->error('Frame at offset ('.$offset.') is has an invalid frame length.'); |
| 1102 | 1102 | return false; |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1110 | 1110 | } else { |
| 1111 | 1111 | |
| 1112 | 1112 | // next frame is not valid, note the error and fail, so scanning can contiue for a valid frame sequence |
| 1113 | | $info['warning'][] = 'Frame at offset ('.$offset.') is valid, but the next one at ('.$nextframetestoffset.') is not.'; |
| | 1113 | $this->warning('Frame at offset ('.$offset.') is valid, but the next one at ('.$nextframetestoffset.') is not.'); |
| 1114 | 1114 | |
| 1115 | 1115 | return false; |
| 1116 | 1116 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1153 | 1153 | $framelength = $framelength2; |
| 1154 | 1154 | } |
| 1155 | 1155 | if (!$framelength) { |
| 1156 | | $info['error'][] = 'Cannot find next free-format synch pattern ('.getid3_lib::PrintHexBytes($SyncPattern1).' or '.getid3_lib::PrintHexBytes($SyncPattern2).') after offset '.$offset; |
| | 1156 | $this->error('Cannot find next free-format synch pattern ('.getid3_lib::PrintHexBytes($SyncPattern1).' or '.getid3_lib::PrintHexBytes($SyncPattern2).') after offset '.$offset); |
| 1157 | 1157 | return false; |
| 1158 | 1158 | } else { |
| 1159 | | $info['warning'][] = 'ModeExtension varies between first frame and other frames (known free-format issue in LAME 3.88)'; |
| | 1159 | $this->warning('ModeExtension varies between first frame and other frames (known free-format issue in LAME 3.88)'); |
| 1160 | 1160 | $info['audio']['codec'] = 'LAME'; |
| 1161 | 1161 | $info['audio']['encoder'] = 'LAME3.88'; |
| 1162 | 1162 | $SyncPattern1 = substr($SyncPattern1, 0, 3); |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1183 | 1183 | $ActualFrameLengthValues[] = ($framelength + 1); |
| 1184 | 1184 | $nextoffset++; |
| 1185 | 1185 | } else { |
| 1186 | | $info['error'][] = 'Did not find expected free-format sync pattern at offset '.$nextoffset; |
| | 1186 | $this->error('Did not find expected free-format sync pattern at offset '.$nextoffset); |
| 1187 | 1187 | return false; |
| 1188 | 1188 | } |
| 1189 | 1189 | $nextoffset += $framelength; |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1281 | 1281 | getid3_lib::safe_inc($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]); |
| 1282 | 1282 | if ($max_frames_scan && (++$frames_scanned >= $max_frames_scan)) { |
| 1283 | 1283 | $pct_data_scanned = ($this->ftell() - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']); |
| 1284 | | $info['warning'][] = 'too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'; |
| | 1284 | $this->warning('too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'); |
| 1285 | 1285 | foreach ($Distribution as $key1 => $value1) { |
| 1286 | 1286 | foreach ($value1 as $key2 => $value2) { |
| 1287 | 1287 | $Distribution[$key1][$key2] = round($value2 / $pct_data_scanned); |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1308 | 1308 | $info['mpeg']['audio']['version_distribution'] = $Distribution['version']; |
| 1309 | 1309 | $info['mpeg']['audio']['padding_distribution'] = $Distribution['padding']; |
| 1310 | 1310 | if (count($Distribution['version']) > 1) { |
| 1311 | | $info['error'][] = 'Corrupt file - more than one MPEG version detected'; |
| | 1311 | $this->error('Corrupt file - more than one MPEG version detected'); |
| 1312 | 1312 | } |
| 1313 | 1313 | if (count($Distribution['layer']) > 1) { |
| 1314 | | $info['error'][] = 'Corrupt file - more than one MPEG layer detected'; |
| | 1314 | $this->error('Corrupt file - more than one MPEG layer detected'); |
| 1315 | 1315 | } |
| 1316 | 1316 | if (count($Distribution['frequency']) > 1) { |
| 1317 | | $info['error'][] = 'Corrupt file - more than one MPEG sample rate detected'; |
| | 1317 | $this->error('Corrupt file - more than one MPEG sample rate detected'); |
| 1318 | 1318 | } |
| 1319 | 1319 | |
| 1320 | 1320 | |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1326 | 1326 | } |
| 1327 | 1327 | $info['mpeg']['audio']['frame_count'] = array_sum($Distribution['bitrate']); |
| 1328 | 1328 | if ($info['mpeg']['audio']['frame_count'] == 0) { |
| 1329 | | $info['error'][] = 'no MPEG audio frames found'; |
| | 1329 | $this->error('no MPEG audio frames found'); |
| 1330 | 1330 | return false; |
| 1331 | 1331 | } |
| 1332 | 1332 | $info['mpeg']['audio']['bitrate'] = ($bittotal / $info['mpeg']['audio']['frame_count']); |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1361 | 1361 | $this->fseek($avdataoffset); |
| 1362 | 1362 | $sync_seek_buffer_size = min(128 * 1024, $info['avdataend'] - $avdataoffset); |
| 1363 | 1363 | if ($sync_seek_buffer_size <= 0) { |
| 1364 | | $info['error'][] = 'Invalid $sync_seek_buffer_size at offset '.$avdataoffset; |
| | 1364 | $this->error('Invalid $sync_seek_buffer_size at offset '.$avdataoffset); |
| 1365 | 1365 | return false; |
| 1366 | 1366 | } |
| 1367 | 1367 | $header = $this->fread($sync_seek_buffer_size); |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1372 | 1372 | |
| 1373 | 1373 | if ($SynchSeekOffset > $sync_seek_buffer_size) { |
| 1374 | 1374 | // if a synch's not found within the first 128k bytes, then give up |
| 1375 | | $info['error'][] = 'Could not find valid MPEG audio synch within the first '.round($sync_seek_buffer_size / 1024).'kB'; |
| | 1375 | $this->error('Could not find valid MPEG audio synch within the first '.round($sync_seek_buffer_size / 1024).'kB'); |
| 1376 | 1376 | if (isset($info['audio']['bitrate'])) { |
| 1377 | 1377 | unset($info['audio']['bitrate']); |
| 1378 | 1378 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1386 | 1386 | |
| 1387 | 1387 | } elseif (feof($this->getid3->fp)) { |
| 1388 | 1388 | |
| 1389 | | $info['error'][] = 'Could not find valid MPEG audio synch before end of file'; |
| | 1389 | $this->error('Could not find valid MPEG audio synch before end of file'); |
| 1390 | 1390 | if (isset($info['audio']['bitrate'])) { |
| 1391 | 1391 | unset($info['audio']['bitrate']); |
| 1392 | 1392 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1401 | 1401 | } |
| 1402 | 1402 | |
| 1403 | 1403 | if (($SynchSeekOffset + 1) >= strlen($header)) { |
| 1404 | | $info['error'][] = 'Could not find valid MPEG synch before end of file'; |
| | 1404 | $this->error('Could not find valid MPEG synch before end of file'); |
| 1405 | 1405 | return false; |
| 1406 | 1406 | } |
| 1407 | 1407 | |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1444 | 1444 | if ($this->decodeMPEGaudioHeader($GarbageOffsetEnd, $dummy, true, true)) { |
| 1445 | 1445 | $info = $dummy; |
| 1446 | 1446 | $info['avdataoffset'] = $GarbageOffsetEnd; |
| 1447 | | $info['warning'][] = 'apparently-valid VBR header not used because could not find '.GETID3_MP3_VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.'), but did find valid CBR stream starting at '.$GarbageOffsetEnd; |
| | 1447 | $this->warning('apparently-valid VBR header not used because could not find '.GETID3_MP3_VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.'), but did find valid CBR stream starting at '.$GarbageOffsetEnd); |
| 1448 | 1448 | } else { |
| 1449 | | $info['warning'][] = 'using data from VBR header even though could not find '.GETID3_MP3_VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.')'; |
| | 1449 | $this->warning('using data from VBR header even though could not find '.GETID3_MP3_VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.')'); |
| 1450 | 1450 | } |
| 1451 | 1451 | } |
| 1452 | 1452 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1539 | 1539 | } |
| 1540 | 1540 | } |
| 1541 | 1541 | if ($pct_data_scanned > 0) { |
| 1542 | | $info['warning'][] = 'too many MPEG audio frames to scan, only scanned '.$frames_scanned.' frames in '.$max_scan_segments.' segments ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'; |
| | 1542 | $this->warning('too many MPEG audio frames to scan, only scanned '.$frames_scanned.' frames in '.$max_scan_segments.' segments ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'); |
| 1543 | 1543 | foreach ($info['mpeg']['audio'] as $key1 => $value1) { |
| 1544 | 1544 | if (!preg_match('#_distribution$#i', $key1)) { |
| 1545 | 1545 | continue; |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1551 | 1551 | } |
| 1552 | 1552 | |
| 1553 | 1553 | if ($SynchErrorsFound > 0) { |
| 1554 | | $info['warning'][] = 'Found '.$SynchErrorsFound.' synch errors in histogram analysis'; |
| | 1554 | $this->warning('Found '.$SynchErrorsFound.' synch errors in histogram analysis'); |
| 1555 | 1555 | //return false; |
| 1556 | 1556 | } |
| 1557 | 1557 | |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1564 | 1564 | } |
| 1565 | 1565 | } |
| 1566 | 1566 | if ($framecounter == 0) { |
| 1567 | | $info['error'][] = 'Corrupt MP3 file: framecounter == zero'; |
| | 1567 | $this->error('Corrupt MP3 file: framecounter == zero'); |
| 1568 | 1568 | return false; |
| 1569 | 1569 | } |
| 1570 | 1570 | $info['mpeg']['audio']['frame_count'] = getid3_lib::CastAsInt($framecounter); |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1599 | 1599 | |
| 1600 | 1600 | if (empty($info['mpeg']['audio'])) { |
| 1601 | 1601 | |
| 1602 | | $info['error'][] = 'could not find valid MPEG synch before end of file'; |
| | 1602 | $this->error('could not find valid MPEG synch before end of file'); |
| 1603 | 1603 | if (isset($info['audio']['bitrate'])) { |
| 1604 | 1604 | unset($info['audio']['bitrate']); |
| 1605 | 1605 | } |
diff --git wp-includes/ID3/module.audio.ogg.php wp-includes/ID3/module.audio.ogg.php
index 2a77768..1e4af6c 100644
|
|
|
class getid3_ogg extends getid3_handler |
| 26 | 26 | |
| 27 | 27 | // Warn about illegal tags - only vorbiscomments are allowed |
| 28 | 28 | if (isset($info['id3v2'])) { |
| 29 | | $info['warning'][] = 'Illegal ID3v2 tag present.'; |
| | 29 | $this->warning('Illegal ID3v2 tag present.'); |
| 30 | 30 | } |
| 31 | 31 | if (isset($info['id3v1'])) { |
| 32 | | $info['warning'][] = 'Illegal ID3v1 tag present.'; |
| | 32 | $this->warning('Illegal ID3v1 tag present.'); |
| 33 | 33 | } |
| 34 | 34 | if (isset($info['ape'])) { |
| 35 | | $info['warning'][] = 'Illegal APE tag present.'; |
| | 35 | $this->warning('Illegal APE tag present.'); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| … |
… |
class getid3_ogg extends getid3_handler |
| 44 | 44 | $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; |
| 45 | 45 | |
| 46 | 46 | if ($this->ftell() >= $this->getid3->fread_buffer_size()) { |
| 47 | | $info['error'][] = 'Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)'; |
| | 47 | $this->error('Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)'); |
| 48 | 48 | unset($info['fileformat']); |
| 49 | 49 | unset($info['ogg']); |
| 50 | 50 | return false; |
| … |
… |
class getid3_ogg extends getid3_handler |
| 179 | 179 | if ($info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] > 0) { |
| 180 | 180 | $info['video']['pixel_aspect_ratio'] = (float) $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] / $info['ogg']['pageheader']['theora']['pixel_aspect_denominator']; |
| 181 | 181 | } |
| 182 | | $info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable'; |
| | 182 | $this->warning('Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable'); |
| 183 | 183 | |
| 184 | 184 | |
| 185 | 185 | } elseif (substr($filedata, 0, 8) == "fishead\x00") { |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 240 | 240 | } elseif (substr($filedata, 1, 6) == 'theora') { |
| 241 | 241 | |
| 242 | 242 | $info['video']['dataformat'] = 'theora1'; |
| 243 | | $info['error'][] = 'Ogg Theora (v1) not correctly handled in this version of getID3 ['.$this->getid3->version().']'; |
| | 243 | $this->error('Ogg Theora (v1) not correctly handled in this version of getID3 ['.$this->getid3->version().']'); |
| 244 | 244 | //break; |
| 245 | 245 | |
| 246 | 246 | } elseif (substr($filedata, 1, 6) == 'vorbis') { |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 248 | 248 | $this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo); |
| 249 | 249 | |
| 250 | 250 | } else { |
| 251 | | $info['error'][] = 'unexpected'; |
| | 251 | $this->error('unexpected'); |
| 252 | 252 | //break; |
| 253 | 253 | } |
| 254 | 254 | //} while ($oggpageinfo['page_seqno'] == 0); |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 256 | 256 | |
| 257 | 257 | $this->fseek($oggpageinfo['page_start_offset']); |
| 258 | 258 | |
| 259 | | $info['error'][] = 'Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']'; |
| | 259 | $this->error('Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']'); |
| 260 | 260 | //return false; |
| 261 | 261 | |
| 262 | 262 | } else { |
| 263 | 263 | |
| 264 | | $info['error'][] = 'Expecting either "Speex ", "OpusHead" or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"'; |
| | 264 | $this->error('Expecting either "Speex ", "OpusHead" or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"'); |
| 265 | 265 | unset($info['ogg']); |
| 266 | 266 | unset($info['mime_type']); |
| 267 | 267 | return false; |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 284 | 284 | case 'flac': |
| 285 | 285 | $flac = new getid3_flac($this->getid3); |
| 286 | 286 | if (!$flac->parseMETAdata()) { |
| 287 | | $info['error'][] = 'Failed to parse FLAC headers'; |
| | 287 | $this->error('Failed to parse FLAC headers'); |
| 288 | 288 | return false; |
| 289 | 289 | } |
| 290 | 290 | unset($flac); |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 299 | 299 | $filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); |
| 300 | 300 | $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, 0, 8); // hard-coded to 'OpusTags' |
| 301 | 301 | if(substr($filedata, 0, 8) != 'OpusTags') { |
| 302 | | $info['error'][] = 'Expected "OpusTags" as header but got "'.substr($filedata, 0, 8).'"'; |
| | 302 | $this->error('Expected "OpusTags" as header but got "'.substr($filedata, 0, 8).'"'); |
| 303 | 303 | return false; |
| 304 | 304 | } |
| 305 | 305 | |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 311 | 311 | // Last Page - Number of Samples |
| 312 | 312 | if (!getid3_lib::intValueSupported($info['avdataend'])) { |
| 313 | 313 | |
| 314 | | $info['warning'][] = 'Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)'; |
| | 314 | $this->warning('Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)'); |
| 315 | 315 | |
| 316 | 316 | } else { |
| 317 | 317 | |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 323 | 323 | $info['ogg']['pageheader']['eos'] = $this->ParseOggPageHeader(); |
| 324 | 324 | $info['ogg']['samples'] = $info['ogg']['pageheader']['eos']['pcm_abs_position']; |
| 325 | 325 | if ($info['ogg']['samples'] == 0) { |
| 326 | | $info['error'][] = 'Corrupt Ogg file: eos.number of samples == zero'; |
| | 326 | $this->error('Corrupt Ogg file: eos.number of samples == zero'); |
| 327 | 327 | return false; |
| 328 | 328 | } |
| 329 | 329 | if (!empty($info['audio']['sample_rate'])) { |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 342 | 342 | } |
| 343 | 343 | if (isset($info['audio']['bitrate']) && !isset($info['playtime_seconds'])) { |
| 344 | 344 | if ($info['audio']['bitrate'] == 0) { |
| 345 | | $info['error'][] = 'Corrupt Ogg file: bitrate_audio == zero'; |
| | 345 | $this->error('Corrupt Ogg file: bitrate_audio == zero'); |
| 346 | 346 | return false; |
| 347 | 347 | } |
| 348 | 348 | $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']); |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 395 | 395 | $info['ogg']['samplerate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); |
| 396 | 396 | $filedataoffset += 4; |
| 397 | 397 | if ($info['ogg']['samplerate'] == 0) { |
| 398 | | $info['error'][] = 'Corrupt Ogg file: sample rate == zero'; |
| | 398 | $this->error('Corrupt Ogg file: sample rate == zero'); |
| 399 | 399 | return false; |
| 400 | 400 | } |
| 401 | 401 | $info['audio']['sample_rate'] = $info['ogg']['samplerate']; |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 443 | 443 | $filedataoffset += 1; |
| 444 | 444 | |
| 445 | 445 | if ($info['ogg']['pageheader']['opus']['version'] < 1 || $info['ogg']['pageheader']['opus']['version'] > 15) { |
| 446 | | $info['error'][] = 'Unknown opus version number (only accepting 1-15)'; |
| | 446 | $this->error('Unknown opus version number (only accepting 1-15)'); |
| 447 | 447 | return false; |
| 448 | 448 | } |
| 449 | 449 | |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 451 | 451 | $filedataoffset += 1; |
| 452 | 452 | |
| 453 | 453 | if ($info['ogg']['pageheader']['opus']['out_channel_count'] == 0) { |
| 454 | | $info['error'][] = 'Invalid channel count in opus header (must not be zero)'; |
| | 454 | $this->error('Invalid channel count in opus header (must not be zero)'); |
| 455 | 455 | return false; |
| 456 | 456 | } |
| 457 | 457 | |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 580 | 580 | |
| 581 | 581 | if ($i >= 10000) { |
| 582 | 582 | // https://github.com/owncloud/music/issues/212#issuecomment-43082336 |
| 583 | | $info['warning'][] = 'Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments'; |
| | 583 | $this->warning('Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments'); |
| 584 | 584 | break; |
| 585 | 585 | } |
| 586 | 586 | |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 618 | 618 | $commentdataoffset += 4; |
| 619 | 619 | while ((strlen($commentdata) - $commentdataoffset) < $ThisFileInfo_ogg_comments_raw[$i]['size']) { |
| 620 | 620 | if (($ThisFileInfo_ogg_comments_raw[$i]['size'] > $info['avdataend']) || ($ThisFileInfo_ogg_comments_raw[$i]['size'] < 0)) { |
| 621 | | $info['warning'][] = 'Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($ThisFileInfo_ogg_comments_raw[$i]['size']).' bytes) - aborting reading comments'; |
| | 621 | $this->warning('Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($ThisFileInfo_ogg_comments_raw[$i]['size']).' bytes) - aborting reading comments'); |
| 622 | 622 | break 2; |
| 623 | 623 | } |
| 624 | 624 | |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 642 | 642 | |
| 643 | 643 | //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); |
| 644 | 644 | if (!isset($info['ogg']['pageheader'][$VorbisCommentPage])) { |
| 645 | | $info['warning'][] = 'undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell(); |
| | 645 | $this->warning('undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell()); |
| 646 | 646 | break; |
| 647 | 647 | } |
| 648 | 648 | $readlength = self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1); |
| 649 | 649 | if ($readlength <= 0) { |
| 650 | | $info['warning'][] = 'invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell(); |
| | 650 | $this->warning('invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell()); |
| 651 | 651 | break; |
| 652 | 652 | } |
| 653 | 653 | $commentdata .= $this->fread($readlength); |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 661 | 661 | if (!$commentstring) { |
| 662 | 662 | |
| 663 | 663 | // no comment? |
| 664 | | $info['warning'][] = 'Blank Ogg comment ['.$i.']'; |
| | 664 | $this->warning('Blank Ogg comment ['.$i.']'); |
| 665 | 665 | |
| 666 | 666 | } elseif (strstr($commentstring, '=')) { |
| 667 | 667 | |
| … |
… |
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of get |
| 711 | 711 | |
| 712 | 712 | } else { |
| 713 | 713 | |
| 714 | | $info['warning'][] = '[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$commentstring; |
| | 714 | $this->warning('[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$commentstring); |
| 715 | 715 | |
| 716 | 716 | } |
| 717 | 717 | unset($ThisFileInfo_ogg_comments_raw[$i]); |
diff --git wp-includes/ID3/module.tag.apetag.php wp-includes/ID3/module.tag.apetag.php
index 724b8b0..0668144 100644
|
|
|
class getid3_apetag extends getid3_handler |
| 23 | 23 | $info = &$this->getid3->info; |
| 24 | 24 | |
| 25 | 25 | if (!getid3_lib::intValueSupported($info['filesize'])) { |
| 26 | | $info['warning'][] = 'Unable to check for APEtags because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; |
| | 26 | $this->warning('Unable to check for APEtags because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); |
| 27 | 27 | return false; |
| 28 | 28 | } |
| 29 | 29 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 72 | 72 | $this->fseek($thisfile_ape['tag_offset_end'] - $apetagheadersize); |
| 73 | 73 | $APEfooterData = $this->fread(32); |
| 74 | 74 | if (!($thisfile_ape['footer'] = $this->parseAPEheaderFooter($APEfooterData))) { |
| 75 | | $info['error'][] = 'Error parsing APE footer at offset '.$thisfile_ape['tag_offset_end']; |
| | 75 | $this->error('Error parsing APE footer at offset '.$thisfile_ape['tag_offset_end']); |
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 88 | 88 | $info['avdataend'] = $thisfile_ape['tag_offset_start']; |
| 89 | 89 | |
| 90 | 90 | if (isset($info['id3v1']['tag_offset_start']) && ($info['id3v1']['tag_offset_start'] < $thisfile_ape['tag_offset_end'])) { |
| 91 | | $info['warning'][] = 'ID3v1 tag information ignored since it appears to be a false synch in APEtag data'; |
| | 91 | $this->warning('ID3v1 tag information ignored since it appears to be a false synch in APEtag data'); |
| 92 | 92 | unset($info['id3v1']); |
| 93 | 93 | foreach ($info['warning'] as $key => $value) { |
| 94 | 94 | if ($value == 'Some ID3v1 fields do not use NULL characters for padding') { |
| … |
… |
class getid3_apetag extends getid3_handler |
| 104 | 104 | if ($thisfile_ape['header'] = $this->parseAPEheaderFooter(substr($APEtagData, 0, $apetagheadersize))) { |
| 105 | 105 | $offset += $apetagheadersize; |
| 106 | 106 | } else { |
| 107 | | $info['error'][] = 'Error parsing APE header at offset '.$thisfile_ape['tag_offset_start']; |
| | 107 | $this->error('Error parsing APE header at offset '.$thisfile_ape['tag_offset_start']); |
| 108 | 108 | return false; |
| 109 | 109 | } |
| 110 | 110 | } |
| … |
… |
class getid3_apetag extends getid3_handler |
| 119 | 119 | $item_flags = getid3_lib::LittleEndian2Int(substr($APEtagData, $offset, 4)); |
| 120 | 120 | $offset += 4; |
| 121 | 121 | if (strstr(substr($APEtagData, $offset), "\x00") === false) { |
| 122 | | $info['error'][] = 'Cannot find null-byte (0x00) seperator between ItemKey #'.$i.' and value. ItemKey starts '.$offset.' bytes into the APE tag, at file offset '.($thisfile_ape['tag_offset_start'] + $offset); |
| | 122 | $this->error('Cannot find null-byte (0x00) seperator between ItemKey #'.$i.' and value. ItemKey starts '.$offset.' bytes into the APE tag, at file offset '.($thisfile_ape['tag_offset_start'] + $offset)); |
| 123 | 123 | return false; |
| 124 | 124 | } |
| 125 | 125 | $ItemKeyLength = strpos($APEtagData, "\x00", $offset) - $offset; |
| … |
… |
class getid3_apetag extends getid3_handler |
| 154 | 154 | $thisfile_replaygain['track']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero! |
| 155 | 155 | $thisfile_replaygain['track']['originator'] = 'unspecified'; |
| 156 | 156 | } else { |
| 157 | | $info['warning'][] = 'MP3gainTrackGain value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'; |
| | 157 | $this->warning('MP3gainTrackGain value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'); |
| 158 | 158 | } |
| 159 | 159 | break; |
| 160 | 160 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 163 | 163 | $thisfile_replaygain['track']['peak'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero! |
| 164 | 164 | $thisfile_replaygain['track']['originator'] = 'unspecified'; |
| 165 | 165 | if ($thisfile_replaygain['track']['peak'] <= 0) { |
| 166 | | $info['warning'][] = 'ReplayGain Track peak from APEtag appears invalid: '.$thisfile_replaygain['track']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")'; |
| | 166 | $this->warning('ReplayGain Track peak from APEtag appears invalid: '.$thisfile_replaygain['track']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")'); |
| 167 | 167 | } |
| 168 | 168 | } else { |
| 169 | | $info['warning'][] = 'MP3gainTrackPeak value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'; |
| | 169 | $this->warning('MP3gainTrackPeak value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'); |
| 170 | 170 | } |
| 171 | 171 | break; |
| 172 | 172 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 175 | 175 | $thisfile_replaygain['album']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero! |
| 176 | 176 | $thisfile_replaygain['album']['originator'] = 'unspecified'; |
| 177 | 177 | } else { |
| 178 | | $info['warning'][] = 'MP3gainAlbumGain value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'; |
| | 178 | $this->warning('MP3gainAlbumGain value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'); |
| 179 | 179 | } |
| 180 | 180 | break; |
| 181 | 181 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 184 | 184 | $thisfile_replaygain['album']['peak'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero! |
| 185 | 185 | $thisfile_replaygain['album']['originator'] = 'unspecified'; |
| 186 | 186 | if ($thisfile_replaygain['album']['peak'] <= 0) { |
| 187 | | $info['warning'][] = 'ReplayGain Album peak from APEtag appears invalid: '.$thisfile_replaygain['album']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")'; |
| | 187 | $this->warning('ReplayGain Album peak from APEtag appears invalid: '.$thisfile_replaygain['album']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")'); |
| 188 | 188 | } |
| 189 | 189 | } else { |
| 190 | | $info['warning'][] = 'MP3gainAlbumPeak value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'; |
| | 190 | $this->warning('MP3gainAlbumPeak value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'); |
| 191 | 191 | } |
| 192 | 192 | break; |
| 193 | 193 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 198 | 198 | $thisfile_replaygain['mp3gain']['undo_right'] = intval($mp3gain_undo_right); |
| 199 | 199 | $thisfile_replaygain['mp3gain']['undo_wrap'] = (($mp3gain_undo_wrap == 'Y') ? true : false); |
| 200 | 200 | } else { |
| 201 | | $info['warning'][] = 'MP3gainUndo value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'; |
| | 201 | $this->warning('MP3gainUndo value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'); |
| 202 | 202 | } |
| 203 | 203 | break; |
| 204 | 204 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 208 | 208 | $thisfile_replaygain['mp3gain']['globalgain_track_min'] = intval($mp3gain_globalgain_min); |
| 209 | 209 | $thisfile_replaygain['mp3gain']['globalgain_track_max'] = intval($mp3gain_globalgain_max); |
| 210 | 210 | } else { |
| 211 | | $info['warning'][] = 'MP3gainMinMax value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'; |
| | 211 | $this->warning('MP3gainMinMax value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'); |
| 212 | 212 | } |
| 213 | 213 | break; |
| 214 | 214 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 218 | 218 | $thisfile_replaygain['mp3gain']['globalgain_album_min'] = intval($mp3gain_globalgain_album_min); |
| 219 | 219 | $thisfile_replaygain['mp3gain']['globalgain_album_max'] = intval($mp3gain_globalgain_album_max); |
| 220 | 220 | } else { |
| 221 | | $info['warning'][] = 'MP3gainAlbumMinMax value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'; |
| | 221 | $this->warning('MP3gainAlbumMinMax value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"'); |
| 222 | 222 | } |
| 223 | 223 | break; |
| 224 | 224 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 253 | 253 | case 'cover art (studio)': |
| 254 | 254 | // list of possible cover arts from http://taglib-sharp.sourcearchive.com/documentation/2.0.3.0-2/Ape_2Tag_8cs-source.html |
| 255 | 255 | if (is_array($thisfile_ape_items_current['data'])) { |
| 256 | | $info['warning'][] = 'APEtag "'.$item_key.'" should be flagged as Binary data, but was incorrectly flagged as UTF-8'; |
| | 256 | $this->warning('APEtag "'.$item_key.'" should be flagged as Binary data, but was incorrectly flagged as UTF-8'); |
| 257 | 257 | $thisfile_ape_items_current['data'] = implode("\x00", $thisfile_ape_items_current['data']); |
| 258 | 258 | } |
| 259 | 259 | list($thisfile_ape_items_current['filename'], $thisfile_ape_items_current['data']) = explode("\x00", $thisfile_ape_items_current['data'], 2); |
| … |
… |
class getid3_apetag extends getid3_handler |
| 276 | 276 | } elseif (is_int($this->inline_attachments)) { |
| 277 | 277 | if ($this->inline_attachments < $thisfile_ape_items_current['data_length']) { |
| 278 | 278 | // too big, skip |
| 279 | | $info['warning'][] = 'attachment at '.$thisfile_ape_items_current['offset'].' is too large to process inline ('.number_format($thisfile_ape_items_current['data_length']).' bytes)'; |
| | 279 | $this->warning('attachment at '.$thisfile_ape_items_current['offset'].' is too large to process inline ('.number_format($thisfile_ape_items_current['data_length']).' bytes)'); |
| 280 | 280 | unset($thisfile_ape_items_current['data']); |
| 281 | 281 | break; |
| 282 | 282 | } |
| … |
… |
class getid3_apetag extends getid3_handler |
| 284 | 284 | $this->inline_attachments = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->inline_attachments), DIRECTORY_SEPARATOR); |
| 285 | 285 | if (!is_dir($this->inline_attachments) || !is_writable($this->inline_attachments)) { |
| 286 | 286 | // cannot write, skip |
| 287 | | $info['warning'][] = 'attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to "'.$this->inline_attachments.'" (not writable)'; |
| | 287 | $this->warning('attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to "'.$this->inline_attachments.'" (not writable)'); |
| 288 | 288 | unset($thisfile_ape_items_current['data']); |
| 289 | 289 | break; |
| 290 | 290 | } |
| … |
… |
class getid3_apetag extends getid3_handler |
| 295 | 295 | if (!file_exists($destination_filename) || is_writable($destination_filename)) { |
| 296 | 296 | file_put_contents($destination_filename, $thisfile_ape_items_current['data']); |
| 297 | 297 | } else { |
| 298 | | $info['warning'][] = 'attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to "'.$destination_filename.'" (not writable)'; |
| | 298 | $this->warning('attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to "'.$destination_filename.'" (not writable)'); |
| 299 | 299 | } |
| 300 | 300 | $thisfile_ape_items_current['data_filename'] = $destination_filename; |
| 301 | 301 | unset($thisfile_ape_items_current['data']); |
diff --git wp-includes/ID3/module.tag.id3v1.php wp-includes/ID3/module.tag.id3v1.php
index 3b4edfd..b51456c 100644
|
|
|
class getid3_id3v1 extends getid3_handler |
| 22 | 22 | $info = &$this->getid3->info; |
| 23 | 23 | |
| 24 | 24 | if (!getid3_lib::intValueSupported($info['filesize'])) { |
| 25 | | $info['warning'][] = 'Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; |
| | 25 | $this->warning('Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); |
| 26 | 26 | return false; |
| 27 | 27 | } |
| 28 | 28 | |
| … |
… |
class getid3_id3v1 extends getid3_handler |
| 73 | 73 | $ParsedID3v1['padding_valid'] = true; |
| 74 | 74 | if ($id3v1tag !== $GoodFormatID3v1tag) { |
| 75 | 75 | $ParsedID3v1['padding_valid'] = false; |
| 76 | | $info['warning'][] = 'Some ID3v1 fields do not use NULL characters for padding'; |
| | 76 | $this->warning('Some ID3v1 fields do not use NULL characters for padding'); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $ParsedID3v1['tag_offset_end'] = $info['filesize']; |
| … |
… |
class getid3_id3v1 extends getid3_handler |
| 95 | 95 | // a Lyrics3 tag footer was found before the last ID3v1, assume false "TAG" synch |
| 96 | 96 | } else { |
| 97 | 97 | // APE and Lyrics3 footers not found - assume double ID3v1 |
| 98 | | $info['warning'][] = 'Duplicate ID3v1 tag detected - this has been known to happen with iTunes'; |
| | 98 | $this->warning('Duplicate ID3v1 tag detected - this has been known to happen with iTunes'); |
| 99 | 99 | $info['avdataend'] -= 128; |
| 100 | 100 | } |
| 101 | 101 | } |
diff --git wp-includes/ID3/module.tag.id3v2.php wp-includes/ID3/module.tag.id3v2.php
index 7092504..fa5b9e2 100644
|
|
|
class getid3_id3v2 extends getid3_handler |
| 71 | 71 | |
| 72 | 72 | if ($id3v2_majorversion > 4) { // this script probably won't correctly parse ID3v2.5.x and above (if it ever exists) |
| 73 | 73 | |
| 74 | | $info['error'][] = 'this script only parses up to ID3v2.4.x - this tag is ID3v2.'.$id3v2_majorversion.'.'.$thisfile_id3v2['minorversion']; |
| | 74 | $this->error('this script only parses up to ID3v2.4.x - this tag is ID3v2.'.$id3v2_majorversion.'.'.$thisfile_id3v2['minorversion']); |
| 75 | 75 | return false; |
| 76 | 76 | |
| 77 | 77 | } |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | if ($thisfile_id3v2['exthead']['length'] != $extended_header_offset) { |
| 244 | | $info['warning'][] = 'ID3v2.4 extended header length mismatch (expecting '.intval($thisfile_id3v2['exthead']['length']).', found '.intval($extended_header_offset).')'; |
| | 244 | $this->warning('ID3v2.4 extended header length mismatch (expecting '.intval($thisfile_id3v2['exthead']['length']).', found '.intval($extended_header_offset).')'); |
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 260 | 260 | if ($framedata{$i} != "\x00") { |
| 261 | 261 | $thisfile_id3v2['padding']['valid'] = false; |
| 262 | 262 | $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i; |
| 263 | | $info['warning'][] = 'Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)'; |
| | 263 | $this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); |
| 264 | 264 | break; |
| 265 | 265 | } |
| 266 | 266 | } |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 300 | 300 | } elseif (($frame_name == "\x00".'MP3') || ($frame_name == "\x00\x00".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) { |
| 301 | 301 | // MP3ext known broken frames - "ok" for the purposes of this test |
| 302 | 302 | } elseif (($id3v2_majorversion == 4) && ($this->IsValidID3v2FrameName(substr($framedata, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0), 4), 3))) { |
| 303 | | $info['warning'][] = 'ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3'; |
| | 303 | $this->warning('ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3'); |
| 304 | 304 | $id3v2_majorversion = 3; |
| 305 | 305 | $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer |
| 306 | 306 | } |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 322 | 322 | if ($framedata{$i} != "\x00") { |
| 323 | 323 | $thisfile_id3v2['padding']['valid'] = false; |
| 324 | 324 | $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i; |
| 325 | | $info['warning'][] = 'Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)'; |
| | 325 | $this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); |
| 326 | 326 | break; |
| 327 | 327 | } |
| 328 | 328 | } |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | if ($frame_name == 'COM ') { |
| 333 | | $info['warning'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably others too)]'; |
| | 333 | $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably others too)]'); |
| 334 | 334 | $frame_name = 'COMM'; |
| 335 | 335 | } |
| 336 | 336 | if (($frame_size <= strlen($framedata)) && ($this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion))) { |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 355 | 355 | |
| 356 | 356 | // next frame is valid, just skip the current frame |
| 357 | 357 | $framedata = substr($framedata, $frame_size); |
| 358 | | $info['warning'][] = 'Next ID3v2 frame is valid, skipping current frame.'; |
| | 358 | $this->warning('Next ID3v2 frame is valid, skipping current frame.'); |
| 359 | 359 | |
| 360 | 360 | } else { |
| 361 | 361 | |
| 362 | 362 | // next frame is invalid too, abort processing |
| 363 | 363 | //unset($framedata); |
| 364 | 364 | $framedata = null; |
| 365 | | $info['error'][] = 'Next ID3v2 frame is also invalid, aborting processing.'; |
| | 365 | $this->error('Next ID3v2 frame is also invalid, aborting processing.'); |
| 366 | 366 | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | } elseif ($frame_size == strlen($framedata)) { |
| 370 | 370 | |
| 371 | 371 | // this is the last frame, just skip |
| 372 | | $info['warning'][] = 'This was the last ID3v2 frame.'; |
| | 372 | $this->warning('This was the last ID3v2 frame.'); |
| 373 | 373 | |
| 374 | 374 | } else { |
| 375 | 375 | |
| 376 | 376 | // next frame is invalid too, abort processing |
| 377 | 377 | //unset($framedata); |
| 378 | 378 | $framedata = null; |
| 379 | | $info['warning'][] = 'Invalid ID3v2 frame size, aborting.'; |
| | 379 | $this->warning('Invalid ID3v2 frame size, aborting.'); |
| 380 | 380 | |
| 381 | 381 | } |
| 382 | 382 | if (!$this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion)) { |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 389 | 389 | case "\x00".'MP': |
| 390 | 390 | case ' MP': |
| 391 | 391 | case 'MP3': |
| 392 | | $info['warning'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by "MP3ext (www.mutschler.de/mp3ext/)"]'; |
| | 392 | $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by "MP3ext (www.mutschler.de/mp3ext/)"]'); |
| 393 | 393 | break; |
| 394 | 394 | |
| 395 | 395 | default: |
| 396 | | $info['warning'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))).'; |
| | 396 | $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))).'); |
| 397 | 397 | break; |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | } elseif (!isset($framedata) || ($frame_size > strlen($framedata))) { |
| 401 | 401 | |
| 402 | | $info['error'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: $frame_size ('.$frame_size.') > strlen($framedata) ('.(isset($framedata) ? strlen($framedata) : 'null').')).'; |
| | 402 | $this->error('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: $frame_size ('.$frame_size.') > strlen($framedata) ('.(isset($framedata) ? strlen($framedata) : 'null').')).'); |
| 403 | 403 | |
| 404 | 404 | } else { |
| 405 | 405 | |
| 406 | | $info['error'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag).'; |
| | 406 | $this->error('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag).'); |
| 407 | 407 | |
| 408 | 408 | } |
| 409 | 409 | |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 571 | 571 | if ($parsedFrame['flags']['compression']) { |
| 572 | 572 | $parsedFrame['decompressed_size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4)); |
| 573 | 573 | if (!function_exists('gzuncompress')) { |
| 574 | | $info['warning'][] = 'gzuncompress() support required to decompress ID3v2 frame "'.$parsedFrame['frame_name'].'"'; |
| | 574 | $this->warning('gzuncompress() support required to decompress ID3v2 frame "'.$parsedFrame['frame_name'].'"'); |
| 575 | 575 | } else { |
| 576 | 576 | if ($decompresseddata = @gzuncompress(substr($parsedFrame['data'], 4))) { |
| 577 | 577 | //if ($decompresseddata = @gzuncompress($parsedFrame['data'])) { |
| 578 | 578 | $parsedFrame['data'] = $decompresseddata; |
| 579 | 579 | unset($decompresseddata); |
| 580 | 580 | } else { |
| 581 | | $info['warning'][] = 'gzuncompress() failed on compressed contents of ID3v2 frame "'.$parsedFrame['frame_name'].'"'; |
| | 581 | $this->warning('gzuncompress() failed on compressed contents of ID3v2 frame "'.$parsedFrame['frame_name'].'"'); |
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | } |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 586 | 586 | |
| 587 | 587 | if (!empty($parsedFrame['flags']['DataLengthIndicator'])) { |
| 588 | 588 | if ($parsedFrame['data_length_indicator'] != strlen($parsedFrame['data'])) { |
| 589 | | $info['warning'][] = 'ID3v2 frame "'.$parsedFrame['frame_name'].'" should be '.$parsedFrame['data_length_indicator'].' bytes long according to DataLengthIndicator, but found '.strlen($parsedFrame['data']).' bytes of data'; |
| | 589 | $this->warning('ID3v2 frame "'.$parsedFrame['frame_name'].'" should be '.$parsedFrame['data_length_indicator'].' bytes long according to DataLengthIndicator, but found '.strlen($parsedFrame['data']).' bytes of data'); |
| 590 | 590 | } |
| 591 | 591 | } |
| 592 | 592 | |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 601 | 601 | default: |
| 602 | 602 | break; |
| 603 | 603 | } |
| 604 | | $info['warning'][] = $warning; |
| | 604 | $this->warning($warning); |
| 605 | 605 | |
| 606 | 606 | } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'UFID')) || // 4.1 UFID Unique file identifier |
| 607 | 607 | (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'UFI'))) { // 4.1 UFI Unique file identifier |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 627 | 627 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 628 | 628 | $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); |
| 629 | 629 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 630 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 630 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 631 | 631 | $frame_textencoding_terminator = "\x00"; |
| 632 | 632 | } |
| 633 | 633 | $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 664 | 664 | $frame_offset = 0; |
| 665 | 665 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 666 | 666 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 667 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 667 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 720 | 720 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 721 | 721 | $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); |
| 722 | 722 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 723 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 723 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 724 | 724 | $frame_textencoding_terminator = "\x00"; |
| 725 | 725 | } |
| 726 | 726 | $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 783 | 783 | $frame_offset = 0; |
| 784 | 784 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 785 | 785 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 786 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 786 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 787 | 787 | } |
| 788 | 788 | $parsedFrame['encodingid'] = $frame_textencoding; |
| 789 | 789 | $parsedFrame['encoding'] = $this->TextEncodingNameLookup($parsedFrame['encodingid']); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 961 | 961 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 962 | 962 | $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); |
| 963 | 963 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 964 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 964 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 965 | 965 | $frame_textencoding_terminator = "\x00"; |
| 966 | 966 | } |
| 967 | 967 | $frame_language = substr($parsedFrame['data'], $frame_offset, 3); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1009 | 1009 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 1010 | 1010 | $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); |
| 1011 | 1011 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 1012 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 1012 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 1013 | 1013 | $frame_textencoding_terminator = "\x00"; |
| 1014 | 1014 | } |
| 1015 | 1015 | $frame_language = substr($parsedFrame['data'], $frame_offset, 3); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1061 | 1061 | |
| 1062 | 1062 | if (strlen($parsedFrame['data']) < 5) { |
| 1063 | 1063 | |
| 1064 | | $info['warning'][] = 'Invalid data (too short) for "'.$parsedFrame['frame_name'].'" frame at offset '.$parsedFrame['dataoffset']; |
| | 1064 | $this->warning('Invalid data (too short) for "'.$parsedFrame['frame_name'].'" frame at offset '.$parsedFrame['dataoffset']); |
| 1065 | 1065 | |
| 1066 | 1066 | } else { |
| 1067 | 1067 | |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1069 | 1069 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 1070 | 1070 | $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); |
| 1071 | 1071 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 1072 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 1072 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 1073 | 1073 | $frame_textencoding_terminator = "\x00"; |
| 1074 | 1074 | } |
| 1075 | 1075 | $frame_language = substr($parsedFrame['data'], $frame_offset, 3); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1132 | 1132 | $frame_offset += 2; |
| 1133 | 1133 | $parsedFrame[$RVA2channelcounter]['bitspeakvolume'] = ord(substr($frame_remainingdata, $frame_offset++, 1)); |
| 1134 | 1134 | if (($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] < 1) || ($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] > 4)) { |
| 1135 | | $info['warning'][] = 'ID3v2::RVA2 frame['.$RVA2channelcounter.'] contains invalid '.$parsedFrame[$RVA2channelcounter]['bitspeakvolume'].'-byte bits-representing-peak value'; |
| | 1135 | $this->warning('ID3v2::RVA2 frame['.$RVA2channelcounter.'] contains invalid '.$parsedFrame[$RVA2channelcounter]['bitspeakvolume'].'-byte bits-representing-peak value'); |
| 1136 | 1136 | break; |
| 1137 | 1137 | } |
| 1138 | 1138 | $frame_bytespeakvolume = ceil($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] / 8); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1341 | 1341 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 1342 | 1342 | $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); |
| 1343 | 1343 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 1344 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 1344 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 1345 | 1345 | $frame_textencoding_terminator = "\x00"; |
| 1346 | 1346 | } |
| 1347 | 1347 | |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1376 | 1376 | $frame_picturetype = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 1377 | 1377 | |
| 1378 | 1378 | if ($frame_offset >= $parsedFrame['datalength']) { |
| 1379 | | $info['warning'][] = 'data portion of APIC frame is missing at offset '.($parsedFrame['dataoffset'] + 8 + $frame_offset); |
| | 1379 | $this->warning('data portion of APIC frame is missing at offset '.($parsedFrame['dataoffset'] + 8 + $frame_offset)); |
| 1380 | 1380 | } else { |
| 1381 | 1381 | $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); |
| 1382 | 1382 | if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1425 | 1425 | } elseif (is_int($this->getid3->option_save_attachments)) { |
| 1426 | 1426 | if ($this->getid3->option_save_attachments < $parsedFrame['data_length']) { |
| 1427 | 1427 | // too big, skip |
| 1428 | | $info['warning'][] = 'attachment at '.$frame_offset.' is too large to process inline ('.number_format($parsedFrame['data_length']).' bytes)'; |
| | 1428 | $this->warning('attachment at '.$frame_offset.' is too large to process inline ('.number_format($parsedFrame['data_length']).' bytes)'); |
| 1429 | 1429 | unset($parsedFrame['data']); |
| 1430 | 1430 | break; |
| 1431 | 1431 | } |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1434 | 1434 | $dir = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR); |
| 1435 | 1435 | if (!is_dir($dir) || !is_writable($dir)) { |
| 1436 | 1436 | // cannot write, skip |
| 1437 | | $info['warning'][] = 'attachment at '.$frame_offset.' cannot be saved to "'.$dir.'" (not writable)'; |
| | 1437 | $this->warning('attachment at '.$frame_offset.' cannot be saved to "'.$dir.'" (not writable)'); |
| 1438 | 1438 | unset($parsedFrame['data']); |
| 1439 | 1439 | break; |
| 1440 | 1440 | } |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1445 | 1445 | if (!file_exists($destination_filename) || is_writable($destination_filename)) { |
| 1446 | 1446 | file_put_contents($destination_filename, $parsedFrame['data']); |
| 1447 | 1447 | } else { |
| 1448 | | $info['warning'][] = 'attachment at '.$frame_offset.' cannot be saved to "'.$destination_filename.'" (not writable)'; |
| | 1448 | $this->warning('attachment at '.$frame_offset.' cannot be saved to "'.$destination_filename.'" (not writable)'); |
| 1449 | 1449 | } |
| 1450 | 1450 | $parsedFrame['data_filename'] = $destination_filename; |
| 1451 | 1451 | unset($parsedFrame['data']); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1482 | 1482 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 1483 | 1483 | $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); |
| 1484 | 1484 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 1485 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 1485 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 1486 | 1486 | $frame_textencoding_terminator = "\x00"; |
| 1487 | 1487 | } |
| 1488 | 1488 | $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1683 | 1683 | $frame_offset = 0; |
| 1684 | 1684 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 1685 | 1685 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 1686 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 1686 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 1687 | 1687 | } |
| 1688 | 1688 | $frame_language = substr($parsedFrame['data'], $frame_offset, 3); |
| 1689 | 1689 | $frame_offset += 3; |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1710 | 1710 | $frame_offset = 0; |
| 1711 | 1711 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 1712 | 1712 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 1713 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 1713 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 1714 | 1714 | } |
| 1715 | 1715 | $parsedFrame['encodingid'] = $frame_textencoding; |
| 1716 | 1716 | $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1751 | 1751 | $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); |
| 1752 | 1752 | $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); |
| 1753 | 1753 | if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { |
| 1754 | | $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'; |
| | 1754 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 1755 | 1755 | $frame_textencoding_terminator = "\x00"; |
| 1756 | 1756 | } |
| 1757 | 1757 | |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 2006 | 2006 | $subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); |
| 2007 | 2007 | $frame_offset += 2; |
| 2008 | 2008 | if ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) { |
| 2009 | | $info['warning'][] = 'CHAP subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)'; |
| | 2009 | $this->warning('CHAP subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)'); |
| 2010 | 2010 | break; |
| 2011 | 2011 | } |
| 2012 | 2012 | $subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 2043 | 2043 | } |
| 2044 | 2044 | $parsedFrame['subframes'][] = $subframe; |
| 2045 | 2045 | } else { |
| 2046 | | $info['warning'][] = 'ID3v2.CHAP subframe "'.$subframe['name'].'" not handled (only TIT2 and TIT3)'; |
| | 2046 | $this->warning('ID3v2.CHAP subframe "'.$subframe['name'].'" not handled (only TIT2 and TIT3)'); |
| 2047 | 2047 | } |
| 2048 | 2048 | } |
| 2049 | 2049 | unset($subframe_rawdata, $subframe, $encoding_converted_text); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 2103 | 2103 | $subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); |
| 2104 | 2104 | $frame_offset += 2; |
| 2105 | 2105 | if ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) { |
| 2106 | | $info['warning'][] = 'CTOS subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)'; |
| | 2106 | $this->warning('CTOS subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)'); |
| 2107 | 2107 | break; |
| 2108 | 2108 | } |
| 2109 | 2109 | $subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 2140 | 2140 | } |
| 2141 | 2141 | $parsedFrame['subframes'][] = $subframe; |
| 2142 | 2142 | } else { |
| 2143 | | $info['warning'][] = 'ID3v2.CTOC subframe "'.$subframe['name'].'" not handled (only TIT2 and TIT3)'; |
| | 2143 | $this->warning('ID3v2.CTOC subframe "'.$subframe['name'].'" not handled (only TIT2 and TIT3)'); |
| 2144 | 2144 | } |
| 2145 | 2145 | } |
| 2146 | 2146 | unset($subframe_rawdata, $subframe, $encoding_converted_text); |
diff --git wp-includes/ID3/module.tag.lyrics3.php wp-includes/ID3/module.tag.lyrics3.php
index 419888b..1645396 100644
|
|
|
class getid3_lyrics3 extends getid3_handler |
| 24 | 24 | // http://www.volweb.cz/str/tags.htm |
| 25 | 25 | |
| 26 | 26 | if (!getid3_lib::intValueSupported($info['filesize'])) { |
| 27 | | $info['warning'][] = 'Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; |
| | 27 | $this->warning('Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); |
| 28 | 28 | return false; |
| 29 | 29 | } |
| 30 | 30 | |
| … |
… |
class getid3_lyrics3 extends getid3_handler |
| 80 | 80 | $lyrics3offset = $info['ape']['tag_offset_start'] - $lyrics3size; |
| 81 | 81 | $info['avdataend'] = $lyrics3offset; |
| 82 | 82 | $lyrics3version = 1; |
| 83 | | $info['warning'][] = 'APE tag located after Lyrics3, will probably break Lyrics3 compatability'; |
| | 83 | $this->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); |
| 84 | 84 | |
| 85 | 85 | } elseif ($lyrics3end == 'LYRICS200') { |
| 86 | 86 | // Lyrics3v2, APE, maybe ID3v1 |
| … |
… |
class getid3_lyrics3 extends getid3_handler |
| 88 | 88 | $lyrics3size = $lyrics3lsz + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' |
| 89 | 89 | $lyrics3offset = $info['ape']['tag_offset_start'] - $lyrics3size; |
| 90 | 90 | $lyrics3version = 2; |
| 91 | | $info['warning'][] = 'APE tag located after Lyrics3, will probably break Lyrics3 compatability'; |
| | 91 | $this->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); |
| 92 | 92 | |
| 93 | 93 | } |
| 94 | 94 | |
| … |
… |
class getid3_lyrics3 extends getid3_handler |
| 117 | 117 | } |
| 118 | 118 | unset($getid3_temp, $getid3_apetag); |
| 119 | 119 | } else { |
| 120 | | $info['warning'][] = 'Lyrics3 and APE tags appear to have become entangled (most likely due to updating the APE tags with a non-Lyrics3-aware tagger)'; |
| | 120 | $this->warning('Lyrics3 and APE tags appear to have become entangled (most likely due to updating the APE tags with a non-Lyrics3-aware tagger)'); |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| … |
… |
class getid3_lyrics3 extends getid3_handler |
| 132 | 132 | $info = &$this->getid3->info; |
| 133 | 133 | |
| 134 | 134 | if (!getid3_lib::intValueSupported($endoffset)) { |
| 135 | | $info['warning'][] = 'Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; |
| | 135 | $this->warning('Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); |
| 136 | 136 | return false; |
| 137 | 137 | } |
| 138 | 138 | |
| … |
… |
class getid3_lyrics3 extends getid3_handler |
| 150 | 150 | if (substr($rawdata, 0, 11) != 'LYRICSBEGIN') { |
| 151 | 151 | if (strpos($rawdata, 'LYRICSBEGIN') !== false) { |
| 152 | 152 | |
| 153 | | $info['warning'][] = '"LYRICSBEGIN" expected at '.$endoffset.' but actually found at '.($endoffset + strpos($rawdata, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$version; |
| | 153 | $this->warning('"LYRICSBEGIN" expected at '.$endoffset.' but actually found at '.($endoffset + strpos($rawdata, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$version); |
| 154 | 154 | $info['avdataend'] = $endoffset + strpos($rawdata, 'LYRICSBEGIN'); |
| 155 | 155 | $rawdata = substr($rawdata, strpos($rawdata, 'LYRICSBEGIN')); |
| 156 | 156 | $length = strlen($rawdata); |
| … |
… |
class getid3_lyrics3 extends getid3_handler |
| 159 | 159 | |
| 160 | 160 | } else { |
| 161 | 161 | |
| 162 | | $info['error'][] = '"LYRICSBEGIN" expected at '.$endoffset.' but found "'.substr($rawdata, 0, 11).'" instead'; |
| | 162 | $this->error('"LYRICSBEGIN" expected at '.$endoffset.' but found "'.substr($rawdata, 0, 11).'" instead'); |
| 163 | 163 | return false; |
| 164 | 164 | |
| 165 | 165 | } |
| … |
… |
class getid3_lyrics3 extends getid3_handler |
| 173 | 173 | $ParsedLyrics3['raw']['LYR'] = trim(substr($rawdata, 11, strlen($rawdata) - 11 - 9)); |
| 174 | 174 | $this->Lyrics3LyricsTimestampParse($ParsedLyrics3); |
| 175 | 175 | } else { |
| 176 | | $info['error'][] = '"LYRICSEND" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead'; |
| | 176 | $this->error('"LYRICSEND" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead'); |
| 177 | 177 | return false; |
| 178 | 178 | } |
| 179 | 179 | break; |
| … |
… |
class getid3_lyrics3 extends getid3_handler |
| 221 | 221 | $this->Lyrics3LyricsTimestampParse($ParsedLyrics3); |
| 222 | 222 | } |
| 223 | 223 | } else { |
| 224 | | $info['error'][] = '"LYRICS200" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead'; |
| | 224 | $this->error('"LYRICS200" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead'); |
| 225 | 225 | return false; |
| 226 | 226 | } |
| 227 | 227 | break; |
| 228 | 228 | |
| 229 | 229 | default: |
| 230 | | $info['error'][] = 'Cannot process Lyrics3 version '.$version.' (only v1 and v2)'; |
| | 230 | $this->error('Cannot process Lyrics3 version '.$version.' (only v1 and v2)'); |
| 231 | 231 | return false; |
| 232 | 232 | break; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
| 236 | 236 | if (isset($info['id3v1']['tag_offset_start']) && ($info['id3v1']['tag_offset_start'] <= $ParsedLyrics3['tag_offset_end'])) { |
| 237 | | $info['warning'][] = 'ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data'; |
| | 237 | $this->warning('ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data'); |
| 238 | 238 | unset($info['id3v1']); |
| 239 | 239 | foreach ($info['warning'] as $key => $value) { |
| 240 | 240 | if ($value == 'Some ID3v1 fields do not use NULL characters for padding') { |