Make WordPress Core


Ignore:
Timestamp:
09/14/2019 07:06:09 PM (6 years ago)
Author:
jorbin
Message:

Update getID3 library to fix issues with PHP7.4

Updates to trunk version that includes fixes for PHP7.4

Changelog:
https://github.com/JamesHeinrich/getID3/compare/v1.9.14...00f3fbfd77e583099ca70a3cf0bc092e113d2b20

See: #47751,#47783.
Fixes: #48040.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ID3/module.tag.lyrics3.php

    r41196 r46112  
    11<?php
     2
    23/////////////////////////////////////////////////////////////////
    34/// getID3() by James Heinrich <info@getid3.org>               //
    4 //  available at http://getid3.sourceforge.net                 //
    5 //            or http://www.getid3.org                         //
    6 //          also https://github.com/JamesHeinrich/getID3       //
    7 /////////////////////////////////////////////////////////////////
    8 // See readme.txt for more details                             //
     5//  available at https://github.com/JamesHeinrich/getID3       //
     6//            or https://www.getid3.org                        //
     7//            or http://getid3.sourceforge.net                 //
     8//  see readme.txt for more details                            //
    99/////////////////////////////////////////////////////////////////
    1010///                                                            //
     
    1818class getid3_lyrics3 extends getid3_handler
    1919{
    20 
     20    /**
     21     * @return bool
     22     */
    2123    public function Analyze() {
    2224        $info = &$this->getid3->info;
     
    6264            // Lyrics3v2, no ID3v1, no APE
    6365
    64             $lyrics3size    = strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'
     66            $lyrics3size    = (int) strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'
    6567            $lyrics3offset  = $info['filesize'] - $lyrics3size;
    6668            $lyrics3version = 2;
     
    9799        }
    98100
    99         if (isset($lyrics3offset)) {
     101        if (isset($lyrics3offset) && isset($lyrics3version) && isset($lyrics3size)) {
    100102            $info['avdataend'] = $lyrics3offset;
    101103            $this->getLyrics3Data($lyrics3offset, $lyrics3version, $lyrics3size);
     
    127129    }
    128130
     131    /**
     132     * @param int $endoffset
     133     * @param int $version
     134     * @param int $length
     135     *
     136     * @return bool
     137     */
    129138    public function getLyrics3Data($endoffset, $version, $length) {
    130139        // http://www.volweb.cz/str/tags.htm
     
    142151        }
    143152        $rawdata = $this->fread($length);
     153
     154        $ParsedLyrics3 = array();
    144155
    145156        $ParsedLyrics3['raw']['lyrics3version'] = $version;
     
    251262    }
    252263
     264    /**
     265     * @param string $rawtimestamp
     266     *
     267     * @return int|false
     268     */
    253269    public function Lyrics3Timestamp2Seconds($rawtimestamp) {
    254270        if (preg_match('#^\\[([0-9]{2}):([0-9]{2})\\]$#', $rawtimestamp, $regs)) {
     
    258274    }
    259275
     276    /**
     277     * @param array $Lyrics3data
     278     *
     279     * @return bool
     280     */
    260281    public function Lyrics3LyricsTimestampParse(&$Lyrics3data) {
    261282        $lyricsarray = explode("\r\n", $Lyrics3data['raw']['LYR']);
     283        $notimestamplyricsarray = array();
    262284        foreach ($lyricsarray as $key => $lyricline) {
    263285            $regs = array();
     
    288310    }
    289311
     312    /**
     313     * @param string $char
     314     *
     315     * @return bool|null
     316     */
    290317    public function IntString2Bool($char) {
    291318        if ($char == '1') {
Note: See TracChangeset for help on using the changeset viewer.