Changeset 29734 for trunk/src/wp-includes/ID3/module.tag.id3v2.php
- Timestamp:
- 09/11/2014 07:06:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/module.tag.id3v2.php
r24696 r29734 4 4 // available at http://getid3.sourceforge.net // 5 5 // or http://www.getid3.org // 6 // also https://github.com/JamesHeinrich/getID3 // 6 7 ///////////////////////////////////////////////////////////////// 7 8 // See readme.txt for more details // … … 52 53 53 54 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); 56 57 if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) { 57 58 … … 132 133 if ($sizeofframes > 0) { 133 134 134 $framedata = fread($this->getid3->fp,$sizeofframes); // read all frames from file into $framedata variable135 $framedata = $this->fread($sizeofframes); // read all frames from file into $framedata variable 135 136 136 137 // if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x) … … 424 425 425 426 if (isset($thisfile_id3v2_flags['isfooter']) && $thisfile_id3v2_flags['isfooter']) { 426 $footer = fread($this->getid3->fp,10);427 $footer = $this->fread(10); 427 428 if (substr($footer, 0, 3) == '3DI') { 428 429 $thisfile_id3v2['footer'] = true; … … 643 644 $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding))); 644 645 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 } 646 652 } 647 653 //unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain … … 1078 1084 $parsedFrame['data'] = $frame_text; 1079 1085 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 } 1081 1092 } 1082 1093 … … 1886 1897 $parsedFrame['bitsperpoint'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); 1887 1898 $frame_bytesperpoint = ceil($parsedFrame['bitsperpoint'] / 8); 1888 for ($i = 0; $i < $ frame_indexpoints; $i++) {1899 for ($i = 0; $i < $parsedFrame['indexpoints']; $i++) { 1889 1900 $parsedFrame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesperpoint)); 1890 1901 $frame_offset += $frame_bytesperpoint; … … 3412 3423 3413 3424 } 3414
Note: See TracChangeset
for help on using the changeset viewer.