Make WordPress Core


Ignore:
Timestamp:
09/11/2014 07:06:33 PM (10 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.id3v2.php

    r24696 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                             //
     
    5253
    5354
    54         fseek($this->getid3->fp, $this->StartingOffset, SEEK_SET);
    55         $header = fread($this->getid3->fp, 10);
     55        $this->fseek($this->StartingOffset);
     56        $header = $this->fread(10);
    5657        if (substr($header, 0, 3) == 'ID3'  &&  strlen($header) == 10) {
    5758
     
    132133        if ($sizeofframes > 0) {
    133134
    134             $framedata = fread($this->getid3->fp, $sizeofframes); // read all frames from file into $framedata variable
     135            $framedata = $this->fread($sizeofframes); // read all frames from file into $framedata variable
    135136
    136137            //    if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x)
     
    424425
    425426        if (isset($thisfile_id3v2_flags['isfooter']) && $thisfile_id3v2_flags['isfooter']) {
    426             $footer = fread($this->getid3->fp, 10);
     427            $footer = $this->fread(10);
    427428            if (substr($footer, 0, 3) == '3DI') {
    428429                $thisfile_id3v2['footer'] = true;
     
    643644            $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
    644645            if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
    645                 $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));
     646                $commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0));
     647                if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) {
     648                    $info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));
     649                } else {
     650                    $info['id3v2']['comments'][$parsedFrame['framenameshort']][]            = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));
     651                }
    646652            }
    647653            //unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain
     
    10781084                $parsedFrame['data']         = $frame_text;
    10791085                if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
    1080                     $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
     1086                    $commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (!empty($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0));
     1087                    if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) {
     1088                        $info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
     1089                    } else {
     1090                        $info['id3v2']['comments'][$parsedFrame['framenameshort']][]            = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
     1091                    }
    10811092                }
    10821093
     
    18861897            $parsedFrame['bitsperpoint'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
    18871898            $frame_bytesperpoint = ceil($parsedFrame['bitsperpoint'] / 8);
    1888             for ($i = 0; $i < $frame_indexpoints; $i++) {
     1899            for ($i = 0; $i < $parsedFrame['indexpoints']; $i++) {
    18891900                $parsedFrame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesperpoint));
    18901901                $frame_offset += $frame_bytesperpoint;
     
    34123423
    34133424}
    3414 
Note: See TracChangeset for help on using the changeset viewer.