diff --git a/src/wp-includes/ID3/getid3.lib.php b/src/wp-includes/ID3/getid3.lib.php
index 8514e9781f..c409e8c9ac 100644
|
a
|
b
|
class getid3_lib |
| 427 | 427 | * @return string |
| 428 | 428 | */ |
| 429 | 429 | public static function Dec2Bin($number) { |
| | 430 | $bytes = array(); // Prevent undefined Array Error |
| 430 | 431 | while ($number >= 256) { |
| 431 | 432 | $bytes[] = (($number / 256) - (floor($number / 256))) * 256; |
| 432 | 433 | $number = floor($number / 256); |
| … |
… |
class getid3_lib |
| 664 | 665 | // $foo = array('path'=>array('to'=>'array('my'=>array('file.txt')))); |
| 665 | 666 | // or |
| 666 | 667 | // $foo['path']['to']['my'] = 'file.txt'; |
| 667 | | $ArrayPath = ltrim($ArrayPath, $Separator); |
| | 668 | $ArrayPath = ltrim($ArrayPath, $Separator); |
| | 669 | $ReturnedArray = array(); // Prevent undefined Array Error |
| 668 | 670 | if (($pos = strpos($ArrayPath, $Separator)) !== false) { |
| 669 | 671 | $ReturnedArray[substr($ArrayPath, 0, $pos)] = self::CreateDeepArray(substr($ArrayPath, $pos + 1), $Separator, $Value); |
| 670 | 672 | } else { |
| … |
… |
class getid3_lib |
| 1734 | 1736 | * @return float|bool |
| 1735 | 1737 | */ |
| 1736 | 1738 | public static function getFileSizeSyscall($path) { |
| 1737 | | $filesize = false; |
| | 1739 | $filesize = false; |
| | 1740 | $commandline = null; // Prevent undefined variable Error |
| 1738 | 1741 | |
| 1739 | 1742 | if (GETID3_OS_ISWINDOWS) { |
| 1740 | 1743 | if (class_exists('COM')) { // From PHP 5.3.15 and 5.4.5, COM and DOTNET is no longer built into the php core.you have to add COM support in php.ini: |
diff --git a/src/wp-includes/ID3/getid3.php b/src/wp-includes/ID3/getid3.php
index 5cb3c036c0..424a7fb36e 100644
|
a
|
b
|
abstract class getid3_handler |
| 2224 | 2224 | * @throws getid3_exception |
| 2225 | 2225 | */ |
| 2226 | 2226 | public function saveAttachment($name, $offset, $length, $image_mime=null) { |
| | 2227 | $fp_dest = null; // Prevent undefined variable Error |
| | 2228 | $dest = null; // Prevent undefined variable Error |
| | 2229 | |
| 2227 | 2230 | try { |
| 2228 | 2231 | |
| 2229 | 2232 | // do not extract at all |
diff --git a/src/wp-includes/ID3/module.audio-video.asf.php b/src/wp-includes/ID3/module.audio-video.asf.php
index fce923c027..679fde6b30 100644
|
a
|
b
|
class getid3_asf extends getid3_handler |
| 93 | 93 | $offset = 0; |
| 94 | 94 | $thisfile_asf_streambitratepropertiesobject = array(); |
| 95 | 95 | $thisfile_asf_codeclistobject = array(); |
| | 96 | $StreamPropertiesObjectData = array(); // Prevent undefined Array Error |
| 96 | 97 | |
| 97 | 98 | for ($HeaderObjectsCounter = 0; $HeaderObjectsCounter < $thisfile_asf_headerobject['headerobjects']; $HeaderObjectsCounter++) { |
| 98 | 99 | $NextObjectGUID = substr($ASFHeaderData, $offset, 16); |
diff --git a/src/wp-includes/ID3/module.audio-video.flv.php b/src/wp-includes/ID3/module.audio-video.flv.php
index 7e684072e3..07c8681e86 100644
|
a
|
b
|
class getid3_flv extends getid3_handler |
| 161 | 161 | $info['flv']['video']['videoCodec'] = $LastHeaderByte & 0x07; |
| 162 | 162 | |
| 163 | 163 | $FLVvideoHeader = $this->fread(11); |
| | 164 | $PictureSizeEnc = array(); // Prevent undefined Array Error |
| 164 | 165 | |
| 165 | 166 | if ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H264) { |
| 166 | 167 | // this code block contributed by: moysevichØgmail*com |
diff --git a/src/wp-includes/ID3/module.audio-video.matroska.php b/src/wp-includes/ID3/module.audio-video.matroska.php
index a285108590..128e614e2c 100644
|
a
|
b
|
class getid3_matroska extends getid3_handler |
| 224 | 224 | * |
| 225 | 225 | * @var bool |
| 226 | 226 | */ |
| 227 | | public static $hide_clusters = true; |
| | 227 | public $hide_clusters = true; |
| 228 | 228 | |
| 229 | 229 | /** |
| 230 | 230 | * True to parse the whole file, not only header [default: FALSE]. |
| 231 | 231 | * |
| 232 | 232 | * @var bool |
| 233 | 233 | */ |
| 234 | | public static $parse_whole_file = false; |
| | 234 | public $parse_whole_file = false; |
| 235 | 235 | |
| 236 | 236 | /* |
| 237 | 237 | * Private parser settings/placeholders. |
| … |
… |
class getid3_matroska extends getid3_handler |
| 586 | 586 | $info['matroska']['segment'][0]['length'] = $top_element['length']; |
| 587 | 587 | |
| 588 | 588 | while ($this->getEBMLelement($element_data, $top_element['end'])) { |
| 589 | | if ($element_data['id'] != EBML_ID_CLUSTER || !self::$hide_clusters) { // collect clusters only if required |
| | 589 | if ($element_data['id'] != EBML_ID_CLUSTER || !$this->hide_clusters) { // collect clusters only if required |
| 590 | 590 | $info['matroska']['segments'][] = $element_data; |
| 591 | 591 | } |
| 592 | 592 | switch ($element_data['id']) { |
| … |
… |
class getid3_matroska extends getid3_handler |
| 618 | 618 | $this->warning('seek_entry[target_id] unexpectedly not set at '.$seek_entry['offset']); |
| 619 | 619 | break; |
| 620 | 620 | } |
| 621 | | if (($seek_entry['target_id'] != EBML_ID_CLUSTER) || !self::$hide_clusters) { // collect clusters only if required |
| | 621 | if (($seek_entry['target_id'] != EBML_ID_CLUSTER) || !$this->hide_clusters) { // collect clusters only if required |
| 622 | 622 | $info['matroska']['seek'][] = $seek_entry; |
| 623 | 623 | } |
| 624 | 624 | break; |
| … |
… |
class getid3_matroska extends getid3_handler |
| 905 | 905 | break; |
| 906 | 906 | |
| 907 | 907 | case EBML_ID_CUES: // A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams. |
| 908 | | if (self::$hide_clusters) { // do not parse cues if hide clusters is "ON" till they point to clusters anyway |
| | 908 | if ($this->hide_clusters) { // do not parse cues if hide clusters is "ON" till they point to clusters anyway |
| 909 | 909 | $this->current_offset = $element_data['end']; |
| 910 | 910 | break; |
| 911 | 911 | } |
| … |
… |
class getid3_matroska extends getid3_handler |
| 1246 | 1246 | } |
| 1247 | 1247 | $this->current_offset = $subelement['end']; |
| 1248 | 1248 | } |
| 1249 | | if (!self::$hide_clusters) { |
| | 1249 | if (!$this->hide_clusters) { |
| 1250 | 1250 | $info['matroska']['cluster'][] = $cluster_entry; |
| 1251 | 1251 | } |
| 1252 | 1252 | |
| 1253 | 1253 | // check to see if all the data we need exists already, if so, break out of the loop |
| 1254 | | if (!self::$parse_whole_file) { |
| | 1254 | if (!$this->parse_whole_file) { |
| 1255 | 1255 | if (isset($info['matroska']['info']) && is_array($info['matroska']['info'])) { |
| 1256 | 1256 | if (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) { |
| 1257 | 1257 | if (count($info['matroska']['track_data_offsets']) == count($info['matroska']['tracks']['tracks'])) { |
diff --git a/src/wp-includes/ID3/module.audio-video.quicktime.php b/src/wp-includes/ID3/module.audio-video.quicktime.php
index 1cf1c0590b..bada8fa0fd 100644
|
a
|
b
|
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE_ |
| 23 | 23 | |
| 24 | 24 | class getid3_quicktime extends getid3_handler |
| 25 | 25 | { |
| 26 | | |
| | 26 | /** audio-video.quicktime |
| | 27 | * return all parsed data from all atoms if true, otherwise just returned parsed metadata |
| | 28 | * |
| | 29 | * @var bool |
| | 30 | */ |
| 27 | 31 | public $ReturnAtomData = true; |
| | 32 | |
| | 33 | /** audio-video.quicktime |
| | 34 | * return all parsed data from all atoms if true, otherwise just returned parsed metadata |
| | 35 | * |
| | 36 | * @var bool |
| | 37 | */ |
| 28 | 38 | public $ParseAllPossibleAtoms = false; |
| 29 | 39 | |
| 30 | 40 | /** |
| … |
… |
class getid3_quicktime extends getid3_handler |
| 728 | 738 | $atom_structure['flags']['play_on_open'] = (bool) $atom_structure['play_on_open_flag']; |
| 729 | 739 | $atom_structure['flags']['slide_show'] = (bool) $atom_structure['slide_show_flag']; |
| 730 | 740 | |
| 731 | | $ptv_lookup[0] = 'normal'; |
| 732 | | $ptv_lookup[1] = 'double'; |
| 733 | | $ptv_lookup[2] = 'half'; |
| 734 | | $ptv_lookup[3] = 'full'; |
| 735 | | $ptv_lookup[4] = 'current'; |
| | 741 | $ptv_lookup = array( |
| | 742 | 0 => 'normal', |
| | 743 | 1 => 'double', |
| | 744 | 2 => 'half', |
| | 745 | 3 => 'full', |
| | 746 | 4 => 'current' |
| | 747 | ); |
| 736 | 748 | if (isset($ptv_lookup[$atom_structure['display_size_raw']])) { |
| 737 | 749 | $atom_structure['display_size'] = $ptv_lookup[$atom_structure['display_size_raw']]; |
| 738 | 750 | } else { |
| … |
… |
$this->warning('incomplete/incorrect handling of "stsd" with Parrot metadata in |
| 1721 | 1733 | 'unknown_data' => array(), |
| 1722 | 1734 | 'debug_list' => '', // Used to debug variables stored as comma delimited strings |
| 1723 | 1735 | ); |
| | 1736 | $debug_structure = array(); |
| 1724 | 1737 | $debug_structure['debug_items'] = array(); |
| 1725 | 1738 | // Can start loop here to decode all sensor data in 32 Byte chunks: |
| 1726 | 1739 | foreach (str_split($atom_SENSOR_data, 32) as $sensor_key => $sensor_data) { |
diff --git a/src/wp-includes/ID3/module.audio-video.riff.php b/src/wp-includes/ID3/module.audio-video.riff.php
index cdf553386b..fbc180c4f5 100644
|
a
|
b
|
class getid3_riff extends getid3_handler |
| 56 | 56 | $thisfile_riff_video = &$thisfile_riff['video']; |
| 57 | 57 | $thisfile_riff_WAVE = array(); |
| 58 | 58 | |
| | 59 | $Original = array(); |
| 59 | 60 | $Original['avdataoffset'] = $info['avdataoffset']; |
| 60 | 61 | $Original['avdataend'] = $info['avdataend']; |
| 61 | 62 | |
| … |
… |
class getid3_riff extends getid3_handler |
| 307 | 308 | $thisfile_riff_WAVE_bext_0['coding_history'] = explode("\r\n", trim(substr($thisfile_riff_WAVE_bext_0['data'], 601))); |
| 308 | 309 | if (preg_match('#^([0-9]{4}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_date'], $matches_bext_date)) { |
| 309 | 310 | if (preg_match('#^([0-9]{2}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_time'], $matches_bext_time)) { |
| | 311 | $bext_timestamp = array(); |
| 310 | 312 | list($dummy, $bext_timestamp['year'], $bext_timestamp['month'], $bext_timestamp['day']) = $matches_bext_date; |
| 311 | 313 | list($dummy, $bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second']) = $matches_bext_time; |
| 312 | 314 | $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']); |
| … |
… |
class getid3_riff extends getid3_handler |
| 733 | 735 | } |
| 734 | 736 | if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) { |
| 735 | 737 | if (is_array($thisfile_riff['AVI ']['hdrl']['strl']['strh'])) { |
| | 738 | $thisfile_riff_raw_strf_strhfccType_streamindex = null; |
| 736 | 739 | for ($i = 0; $i < count($thisfile_riff['AVI ']['hdrl']['strl']['strh']); $i++) { |
| 737 | 740 | if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) { |
| 738 | 741 | $strhData = $thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data']; |
| … |
… |
class getid3_riff extends getid3_handler |
| 1514 | 1517 | |
| 1515 | 1518 | $RIFFchunk = false; |
| 1516 | 1519 | $FoundAllChunksWeNeed = false; |
| | 1520 | $LISTchunkParent = null; |
| | 1521 | $LISTchunkMaxOffset = null; |
| 1517 | 1522 | |
| 1518 | 1523 | try { |
| 1519 | 1524 | $this->fseek($startoffset); |
| … |
… |
class getid3_riff extends getid3_handler |
| 2076 | 2081 | */ |
| 2077 | 2082 | public static function ParseBITMAPINFOHEADER($BITMAPINFOHEADER, $littleEndian=true) { |
| 2078 | 2083 | |
| | 2084 | $parsed = array(); |
| 2079 | 2085 | $parsed['biSize'] = substr($BITMAPINFOHEADER, 0, 4); // number of bytes required by the BITMAPINFOHEADER structure |
| 2080 | 2086 | $parsed['biWidth'] = substr($BITMAPINFOHEADER, 4, 4); // width of the bitmap in pixels |
| 2081 | 2087 | $parsed['biHeight'] = substr($BITMAPINFOHEADER, 8, 4); // height of the bitmap in pixels. If biHeight is positive, the bitmap is a 'bottom-up' DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a 'top-down' DIB and its origin is the upper left corner |
diff --git a/src/wp-includes/ID3/module.audio.flac.php b/src/wp-includes/ID3/module.audio.flac.php
index 1cea4364c2..4680099f94 100644
|
a
|
b
|
class getid3_flac extends getid3_handler |
| 402 | 402 | public function parsePICTURE() { |
| 403 | 403 | $info = &$this->getid3->info; |
| 404 | 404 | |
| | 405 | $picture = array(); // Prevent undefined Array Error |
| 405 | 406 | $picture['typeid'] = getid3_lib::BigEndian2Int($this->fread(4)); |
| 406 | 407 | $picture['picturetype'] = self::pictureTypeLookup($picture['typeid']); |
| 407 | 408 | $picture['image_mime'] = $this->fread(getid3_lib::BigEndian2Int($this->fread(4))); |
diff --git a/src/wp-includes/ID3/module.audio.mp3.php b/src/wp-includes/ID3/module.audio.mp3.php
index 26b28068f8..884a6d9bdd 100644
|
a
|
b
|
class getid3_mp3 extends getid3_handler |
| 55 | 55 | $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); |
| 56 | 56 | } |
| 57 | 57 | |
| | 58 | $CurrentDataLAMEversionString = null; |
| 58 | 59 | if (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0) && ($info['avdataoffset'] != $initialOffset)))) { |
| 59 | 60 | |
| 60 | 61 | $synchoffsetwarning = 'Unknown data before synch '; |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1273 | 1274 | $LongMPEGbitrateLookup = array(); |
| 1274 | 1275 | $LongMPEGpaddingLookup = array(); |
| 1275 | 1276 | $LongMPEGfrequencyLookup = array(); |
| | 1277 | $Distribution = array(); |
| 1276 | 1278 | $Distribution['bitrate'] = array(); |
| 1277 | 1279 | $Distribution['frequency'] = array(); |
| 1278 | 1280 | $Distribution['layer'] = array(); |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1558 | 1560 | $pct_data_scanned = 0; |
| 1559 | 1561 | for ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) { |
| 1560 | 1562 | $frames_scanned_this_segment = 0; |
| | 1563 | $scan_start_offset = array(); |
| 1561 | 1564 | if ($this->ftell() >= $info['avdataend']) { |
| 1562 | 1565 | break; |
| 1563 | 1566 | } |
| … |
… |
class getid3_mp3 extends getid3_handler |
| 1887 | 1890 | return false; |
| 1888 | 1891 | } |
| 1889 | 1892 | |
| | 1893 | $MPEGrawHeader = array(); |
| 1890 | 1894 | $MPEGrawHeader['synch'] = (getid3_lib::BigEndian2Int(substr($Header4Bytes, 0, 2)) & 0xFFE0) >> 4; |
| 1891 | 1895 | $MPEGrawHeader['version'] = (ord($Header4Bytes[1]) & 0x18) >> 3; // BB |
| 1892 | 1896 | $MPEGrawHeader['layer'] = (ord($Header4Bytes[1]) & 0x06) >> 1; // CC |
diff --git a/src/wp-includes/ID3/module.audio.ogg.php b/src/wp-includes/ID3/module.audio.ogg.php
index fe092d9d94..47c10c392c 100644
|
a
|
b
|
class getid3_ogg extends getid3_handler |
| 529 | 529 | */ |
| 530 | 530 | public function ParseOggPageHeader() { |
| 531 | 531 | // http://xiph.org/ogg/vorbis/doc/framing.html |
| | 532 | $oggheader = array(); |
| 532 | 533 | $oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file |
| 533 | 534 | |
| 534 | 535 | $filedata = $this->fread($this->getid3->fread_buffer_size()); |
diff --git a/src/wp-includes/ID3/module.tag.apetag.php b/src/wp-includes/ID3/module.tag.apetag.php
index 26be982c73..040d457c5d 100644
|
a
|
b
|
class getid3_apetag extends getid3_handler |
| 360 | 360 | // http://www.uni-jena.de/~pfk/mpp/sv8/apeheader.html |
| 361 | 361 | |
| 362 | 362 | // shortcut |
| | 363 | $headerfooterinfo = array(); |
| 363 | 364 | $headerfooterinfo['raw'] = array(); |
| 364 | 365 | $headerfooterinfo_raw = &$headerfooterinfo['raw']; |
| 365 | 366 | |
| … |
… |
class getid3_apetag extends getid3_handler |
| 389 | 390 | // "Note: APE Tags 1.0 do not use any of the APE Tag flags. |
| 390 | 391 | // All are set to zero on creation and ignored on reading." |
| 391 | 392 | // http://wiki.hydrogenaud.io/index.php?title=Ape_Tags_Flags |
| | 393 | $flags = array(); |
| 392 | 394 | $flags['header'] = (bool) ($rawflagint & 0x80000000); |
| 393 | 395 | $flags['footer'] = (bool) ($rawflagint & 0x40000000); |
| 394 | 396 | $flags['this_is_header'] = (bool) ($rawflagint & 0x20000000); |
diff --git a/src/wp-includes/ID3/module.tag.id3v1.php b/src/wp-includes/ID3/module.tag.id3v1.php
index 16dcf253b6..144c9a8374 100644
|
a
|
b
|
class getid3_id3v1 extends getid3_handler |
| 39 | 39 | |
| 40 | 40 | $info['avdataend'] = $info['filesize'] - 128; |
| 41 | 41 | |
| | 42 | $ParsedID3v1 = array(); |
| 42 | 43 | $ParsedID3v1['title'] = $this->cutfield(substr($id3v1tag, 3, 30)); |
| 43 | 44 | $ParsedID3v1['artist'] = $this->cutfield(substr($id3v1tag, 33, 30)); |
| 44 | 45 | $ParsedID3v1['album'] = $this->cutfield(substr($id3v1tag, 63, 30)); |
diff --git a/src/wp-includes/ID3/module.tag.id3v2.php b/src/wp-includes/ID3/module.tag.id3v2.php
index 85dd7a147a..5769e2e90f 100644
|
a
|
b
|
class getid3_id3v2 extends getid3_handler |
| 345 | 345 | } |
| 346 | 346 | if (($frame_size <= strlen($framedata)) && ($this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion))) { |
| 347 | 347 | |
| 348 | | unset($parsedFrame); |
| | 348 | $parsedFrame = array(); |
| 349 | 349 | $parsedFrame['frame_name'] = $frame_name; |
| 350 | 350 | $parsedFrame['frame_flags_raw'] = $frame_flags; |
| 351 | 351 | $parsedFrame['data'] = substr($framedata, 0, $frame_size); |
| … |
… |
class getid3_id3v2 extends getid3_handler |
| 1369 | 1369 | $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); |
| 1370 | 1370 | $frame_textencoding_terminator = "\x00"; |
| 1371 | 1371 | } |
| 1372 | | |
| | 1372 | $frame_imagetype = null; |
| | 1373 | $frame_mimetype = null; |
| 1373 | 1374 | if ($id3v2_majorversion == 2 && strlen($parsedFrame['data']) > $frame_offset) { |
| 1374 | 1375 | $frame_imagetype = substr($parsedFrame['data'], $frame_offset, 3); |
| 1375 | 1376 | if (strtolower($frame_imagetype) == 'ima') { |
diff --git a/src/wp-includes/ID3/module.tag.lyrics3.php b/src/wp-includes/ID3/module.tag.lyrics3.php
index b2375057e7..c8b2cf6305 100644
|
a
|
b
|
class getid3_lyrics3 extends getid3_handler |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $this->fseek((0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - "LYRICSEND" - [Lyrics3size] |
| | 36 | $lyrics3offset = null; |
| | 37 | $lyrics3version = null; |
| | 38 | $lyrics3size = null; |
| 36 | 39 | $lyrics3_id3v1 = $this->fread(128 + 9 + 6); |
| 37 | 40 | $lyrics3lsz = (int) substr($lyrics3_id3v1, 0, 6); // Lyrics3size |
| 38 | 41 | $lyrics3end = substr($lyrics3_id3v1, 6, 9); // LYRICSEND or LYRICS200 |