Make WordPress Core


Ignore:
Timestamp:
07/31/2017 07:49:31 PM (9 years ago)
Author:
wonderboymusic
Message:

Media: update the getID3 library to version 1.9.14 to avoid fatal errors in PHP7.

Props MyThemeShop for the initial patch.
Fixes #41496.

File:
1 edited

Legend:

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

    r32979 r41196  
    2525
    2626                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');
    2828                        return false;
    2929                }
     
    8181                                        $info['avdataend'] = $lyrics3offset;
    8282                                        $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');
    8484
    8585                                } elseif ($lyrics3end == 'LYRICS200') {
     
    8989                                        $lyrics3offset  = $info['ape']['tag_offset_start'] - $lyrics3size;
    9090                                        $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');
    9292
    9393                                }
     
    118118                                        unset($getid3_temp, $getid3_apetag);
    119119                                } 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)');
    121121                                }
    122122                        }
     
    133133
    134134                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');
    136136                        return false;
    137137                }
     
    151151                        if (strpos($rawdata, 'LYRICSBEGIN') !== false) {
    152152
    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);
    154154                                $info['avdataend'] = $endoffset + strpos($rawdata, 'LYRICSBEGIN');
    155155                                $rawdata = substr($rawdata, strpos($rawdata, 'LYRICSBEGIN'));
     
    160160                        } else {
    161161
    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');
    163163                                return false;
    164164
     
    174174                                        $this->Lyrics3LyricsTimestampParse($ParsedLyrics3);
    175175                                } 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');
    177177                                        return false;
    178178                                }
     
    222222                                        }
    223223                                } 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');
    225225                                        return false;
    226226                                }
     
    228228
    229229                        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)');
    231231                                return false;
    232232                                break;
     
    235235
    236236                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');
    238238                        unset($info['id3v1']);
    239239                        foreach ($info['warning'] as $key => $value) {
Note: See TracChangeset for help on using the changeset viewer.