Make WordPress Core


Ignore:
Timestamp:
10/10/2021 01:15:16 AM (3 years ago)
Author:
SergeyBiryukov
Message:

External Libraries: Revert [51900] for now to investigate test failures.

See #54162.

File:
1 edited

Legend:

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

    r51900 r51901  
    346346                if (($frame_size <= strlen($framedata)) && ($this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion))) {
    347347
    348                     $parsedFrame                    = array();
     348                    unset($parsedFrame);
    349349                    $parsedFrame['frame_name']      = $frame_name;
    350350                    $parsedFrame['frame_flags_raw'] = $frame_flags;
     
    979979
    980980        } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USLT')) || // 4.8   USLT Unsynchronised lyric/text transcription
    981                 (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ULT'))) {    // 4.9   ULT  Unsynchronised lyric/text transcription
     981                (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ULT'))) {     // 4.9   ULT  Unsynchronised lyric/text transcription
    982982            //   There may be more than one 'Unsynchronised lyrics/text transcription' frame
    983983            //   in each tag, but only one with the same language and content descriptor.
     
    995995                $frame_textencoding_terminator = "\x00";
    996996            }
    997             if (strlen($parsedFrame['data']) >= (4 + strlen($frame_textencoding_terminator))) {  // shouldn't be an issue but badly-written files have been spotted in the wild with not only no contents but also missing the required language field, see https://github.com/JamesHeinrich/getID3/issues/315
    998                 $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
    999                 $frame_offset += 3;
    1000                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
    1001                 if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
    1002                     $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
    1003                 }
    1004                 $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
    1005                 $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);
    1006                 $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));
    1007                 $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $frame_textencoding_terminator);
    1008 
    1009                 $parsedFrame['encodingid']   = $frame_textencoding;
    1010                 $parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
    1011 
    1012                 $parsedFrame['language']     = $frame_language;
    1013                 $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);
    1014                 if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
    1015                     $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
    1016                 }
    1017             } else {
    1018                 $this->warning('Invalid data in frame "'.$parsedFrame['frame_name'].'" at offset '.$parsedFrame['dataoffset']);
     997            $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
     998            $frame_offset += 3;
     999            $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
     1000            if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
     1001                $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
     1002            }
     1003            $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
     1004            $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);
     1005            $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));
     1006            $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $frame_textencoding_terminator);
     1007
     1008            $parsedFrame['encodingid']   = $frame_textencoding;
     1009            $parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
     1010
     1011            $parsedFrame['language']     = $frame_language;
     1012            $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);
     1013            if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
     1014                $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
    10191015            }
    10201016            unset($parsedFrame['data']);
     
    13751371            }
    13761372
    1377             $frame_imagetype = null;
    1378             $frame_mimetype = null;
    13791373            if ($id3v2_majorversion == 2 && strlen($parsedFrame['data']) > $frame_offset) {
    13801374                $frame_imagetype = substr($parsedFrame['data'], $frame_offset, 3);
     
    19631957            $parsedFrame['peakamplitude'] = getid3_lib::BigEndian2Float(substr($parsedFrame['data'], $frame_offset, 4));
    19641958            $frame_offset += 4;
    1965             foreach (array('track','album') as $rgad_entry_type) {
    1966                 $rg_adjustment_word = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
    1967                 $frame_offset += 2;
    1968                 $parsedFrame['raw'][$rgad_entry_type]['name']       = ($rg_adjustment_word & 0xE000) >> 13;
    1969                 $parsedFrame['raw'][$rgad_entry_type]['originator'] = ($rg_adjustment_word & 0x1C00) >> 10;
    1970                 $parsedFrame['raw'][$rgad_entry_type]['signbit']    = ($rg_adjustment_word & 0x0200) >>  9;
    1971                 $parsedFrame['raw'][$rgad_entry_type]['adjustment'] = ($rg_adjustment_word & 0x0100);
    1972             }
     1959            $rg_track_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));
     1960            $frame_offset += 2;
     1961            $rg_album_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));
     1962            $frame_offset += 2;
     1963            $parsedFrame['raw']['track']['name']       = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 0, 3));
     1964            $parsedFrame['raw']['track']['originator'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 3, 3));
     1965            $parsedFrame['raw']['track']['signbit']    = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 6, 1));
     1966            $parsedFrame['raw']['track']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 7, 9));
     1967            $parsedFrame['raw']['album']['name']       = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 0, 3));
     1968            $parsedFrame['raw']['album']['originator'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 3, 3));
     1969            $parsedFrame['raw']['album']['signbit']    = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 6, 1));
     1970            $parsedFrame['raw']['album']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 7, 9));
    19731971            $parsedFrame['track']['name']       = getid3_lib::RGADnameLookup($parsedFrame['raw']['track']['name']);
    19741972            $parsedFrame['track']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['track']['originator']);
     
    24472445            TND Dinars
    24482446            TOP Pa'anga
    2449             TRL Liras (old)
    2450             TRY Liras
     2447            TRL Liras
    24512448            TTD Dollars
    24522449            TVD Tuvalu Dollars
     
    26492646            TOP Tonga
    26502647            TRL Turkey
    2651             TRY Turkey
    26522648            TTD Trinidad and Tobago
    26532649            TVD Tuvalu
Note: See TracChangeset for help on using the changeset viewer.