WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/10/2021 12:12:03 AM (8 weeks ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update getID3 to version 1.9.21.

The latest version includes preliminary PHP 8.1 support, as well as a variety of bug fixes.

Release notes: https://github.com/JamesHeinrich/getID3/releases/tag/v1.9.21

A full list of changes in this update can be found on GitHub:
https://github.com/JamesHeinrich/getID3/compare/v1.9.20...v1.9.21

This commit also includes PHPCS adjustments previously made for a passing PHP Compatibility scan.

Follow-up to [47601], [47737], [47902], [48278], [49621], [50714].

Props jrf, SergeyBiryukov.
Fixes #54162.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ID3/module.audio.ogg.php

    r48278 r51900  
    530530    public function ParseOggPageHeader() {
    531531        // http://xiph.org/ogg/vorbis/doc/framing.html
     532        $oggheader = array();
    532533        $oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file
    533534
     
    681682                $VorbisCommentPage++;
    682683
    683                 $oggpageinfo = $this->ParseOggPageHeader();
    684                 $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;
    685 
    686                 // First, save what we haven't read yet
    687                 $AsYetUnusedData = substr($commentdata, $commentdataoffset);
    688 
    689                 // Then take that data off the end
    690                 $commentdata     = substr($commentdata, 0, $commentdataoffset);
    691 
    692                 // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct
    693                 $commentdata .= str_repeat("\x00", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);
    694                 $commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);
    695 
    696                 // Finally, stick the unused data back on the end
    697                 $commentdata .= $AsYetUnusedData;
    698 
    699                 //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
    700                 if (!isset($info['ogg']['pageheader'][$VorbisCommentPage])) {
    701                     $this->warning('undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell());
     684                if ($oggpageinfo = $this->ParseOggPageHeader()) {
     685                    $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;
     686
     687                    // First, save what we haven't read yet
     688                    $AsYetUnusedData = substr($commentdata, $commentdataoffset);
     689
     690                    // Then take that data off the end
     691                    $commentdata     = substr($commentdata, 0, $commentdataoffset);
     692
     693                    // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct
     694                    $commentdata .= str_repeat("\x00", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);
     695                    $commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);
     696
     697                    // Finally, stick the unused data back on the end
     698                    $commentdata .= $AsYetUnusedData;
     699
     700                    //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
     701                    if (!isset($info['ogg']['pageheader'][$VorbisCommentPage])) {
     702                        $this->warning('undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell());
     703                        break;
     704                    }
     705                    $readlength = self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1);
     706                    if ($readlength <= 0) {
     707                        $this->warning('invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell());
     708                        break;
     709                    }
     710                    $commentdata .= $this->fread($readlength);
     711
     712                    //$filebaseoffset += $oggpageinfo['header_end_offset'] - $oggpageinfo['page_start_offset'];
     713                } else {
     714                    $this->warning('failed to ParseOggPageHeader() at offset '.$this->ftell());
    702715                    break;
    703716                }
    704                 $readlength = self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1);
    705                 if ($readlength <= 0) {
    706                     $this->warning('invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell());
    707                     break;
    708                 }
    709                 $commentdata .= $this->fread($readlength);
    710 
    711                 //$filebaseoffset += $oggpageinfo['header_end_offset'] - $oggpageinfo['page_start_offset'];
    712717            }
    713718            $ThisFileInfo_ogg_comments_raw[$i]['offset'] = $commentdataoffset;
Note: See TracChangeset for help on using the changeset viewer.