Changeset 46112 for trunk/src/wp-includes/ID3/module.tag.lyrics3.php
- Timestamp:
- 09/14/2019 07:06:09 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/module.tag.lyrics3.php
r41196 r46112 1 1 <?php 2 2 3 ///////////////////////////////////////////////////////////////// 3 4 /// 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 // 9 9 ///////////////////////////////////////////////////////////////// 10 10 /// // … … 18 18 class getid3_lyrics3 extends getid3_handler 19 19 { 20 20 /** 21 * @return bool 22 */ 21 23 public function Analyze() { 22 24 $info = &$this->getid3->info; … … 62 64 // Lyrics3v2, no ID3v1, no APE 63 65 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' 65 67 $lyrics3offset = $info['filesize'] - $lyrics3size; 66 68 $lyrics3version = 2; … … 97 99 } 98 100 99 if (isset($lyrics3offset) ) {101 if (isset($lyrics3offset) && isset($lyrics3version) && isset($lyrics3size)) { 100 102 $info['avdataend'] = $lyrics3offset; 101 103 $this->getLyrics3Data($lyrics3offset, $lyrics3version, $lyrics3size); … … 127 129 } 128 130 131 /** 132 * @param int $endoffset 133 * @param int $version 134 * @param int $length 135 * 136 * @return bool 137 */ 129 138 public function getLyrics3Data($endoffset, $version, $length) { 130 139 // http://www.volweb.cz/str/tags.htm … … 142 151 } 143 152 $rawdata = $this->fread($length); 153 154 $ParsedLyrics3 = array(); 144 155 145 156 $ParsedLyrics3['raw']['lyrics3version'] = $version; … … 251 262 } 252 263 264 /** 265 * @param string $rawtimestamp 266 * 267 * @return int|false 268 */ 253 269 public function Lyrics3Timestamp2Seconds($rawtimestamp) { 254 270 if (preg_match('#^\\[([0-9]{2}):([0-9]{2})\\]$#', $rawtimestamp, $regs)) { … … 258 274 } 259 275 276 /** 277 * @param array $Lyrics3data 278 * 279 * @return bool 280 */ 260 281 public function Lyrics3LyricsTimestampParse(&$Lyrics3data) { 261 282 $lyricsarray = explode("\r\n", $Lyrics3data['raw']['LYR']); 283 $notimestamplyricsarray = array(); 262 284 foreach ($lyricsarray as $key => $lyricline) { 263 285 $regs = array(); … … 288 310 } 289 311 312 /** 313 * @param string $char 314 * 315 * @return bool|null 316 */ 290 317 public function IntString2Bool($char) { 291 318 if ($char == '1') {
Note: See TracChangeset
for help on using the changeset viewer.