Make WordPress Core


Ignore:
Timestamp:
09/11/2014 07:06:33 PM (12 years ago)
Author:
wonderboymusic
Message:

Update getID3 library to 1.9.8.

Changes:
​https://github.com/JamesHeinrich/getID3/compare/1.9.7...v1.9.8

Fixes #29627.

File:
1 edited

Legend:

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

    r23766 r29734  
    44//  available at http://getid3.sourceforge.net                 //
    55//            or http://www.getid3.org                         //
     6//          also https://github.com/JamesHeinrich/getID3       //
    67/////////////////////////////////////////////////////////////////
    78// See readme.txt for more details                             //
    … …  
    2829                }
    2930
    30                 fseek($this->getid3->fp, (0 - 128 - 9 - 6), SEEK_END);          // end - ID3v1 - "LYRICSEND" - [Lyrics3size]
    31                 $lyrics3_id3v1 = fread($this->getid3->fp, 128 + 9 + 6);
     31                $this->fseek((0 - 128 - 9 - 6), SEEK_END);          // end - ID3v1 - "LYRICSEND" - [Lyrics3size]
     32                $lyrics3_id3v1 = $this->fread(128 + 9 + 6);
    3233                $lyrics3lsz    = substr($lyrics3_id3v1,  0,   6); // Lyrics3size
    3334                $lyrics3end    = substr($lyrics3_id3v1,  6,   9); // LYRICSEND or LYRICS200
    … …  
    6970                        if (isset($info['ape']['tag_offset_start']) && ($info['ape']['tag_offset_start'] > 15)) {
    7071
    71                                 fseek($this->getid3->fp, $info['ape']['tag_offset_start'] - 15, SEEK_SET);
    72                                 $lyrics3lsz = fread($this->getid3->fp, 6);
    73                                 $lyrics3end = fread($this->getid3->fp, 9);
     72                                $this->fseek($info['ape']['tag_offset_start'] - 15);
     73                                $lyrics3lsz = $this->fread(6);
     74                                $lyrics3end = $this->fread(9);
    7475
    7576                                if ($lyrics3end == 'LYRICSEND') {
    … …  
    102103                        if (!isset($info['ape'])) {
    103104                                $GETID3_ERRORARRAY = &$info['warning'];
    104                                 if (getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, false)) {
    105                                         $getid3_temp = new getID3();
    106                                         $getid3_temp->openfile($this->getid3->filename);
    107                                         $getid3_apetag = new getid3_apetag($getid3_temp);
    108                                         $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
    109                                         $getid3_apetag->Analyze();
    110                                         if (!empty($getid3_temp->info['ape'])) {
    111                                                 $info['ape'] = $getid3_temp->info['ape'];
    112                                         }
    113                                         if (!empty($getid3_temp->info['replay_gain'])) {
    114                                                 $info['replay_gain'] = $getid3_temp->info['replay_gain'];
    115                                         }
    116                                         unset($getid3_temp, $getid3_apetag);
    117                                 }
     105                                getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
     106                                $getid3_temp = new getID3();
     107                                $getid3_temp->openfile($this->getid3->filename);
     108                                $getid3_apetag = new getid3_apetag($getid3_temp);
     109                                $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
     110                                $getid3_apetag->Analyze();
     111                                if (!empty($getid3_temp->info['ape'])) {
     112                                        $info['ape'] = $getid3_temp->info['ape'];
     113                                }
     114                                if (!empty($getid3_temp->info['replay_gain'])) {
     115                                        $info['replay_gain'] = $getid3_temp->info['replay_gain'];
     116                                }
     117                                unset($getid3_temp, $getid3_apetag);
    118118                        }
    119119
    … …  
    133133                }
    134134
    135                 fseek($this->getid3->fp, $endoffset, SEEK_SET);
     135                $this->fseek($endoffset);
    136136                if ($length <= 0) {
    137137                        return false;
    138138                }
    139                 $rawdata = fread($this->getid3->fp, $length);
     139                $rawdata = $this->fread($length);
    140140
    141141                $ParsedLyrics3['raw']['lyrics3version'] = $version;
    … …  
    170170                                        $this->Lyrics3LyricsTimestampParse($ParsedLyrics3);
    171171                                } else {
    172                                         $info['error'][] = '"LYRICSEND" expected at '.(ftell($this->getid3->fp) - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
     172                                        $info['error'][] = '"LYRICSEND" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
    173173                                        return false;
    174174                                }
    … …  
    218218                                        }
    219219                                } else {
    220                                         $info['error'][] = '"LYRICS200" expected at '.(ftell($this->getid3->fp) - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
     220                                        $info['error'][] = '"LYRICS200" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
    221221                                        return false;
    222222                                }
Note: See TracChangeset for help on using the changeset viewer.