Make WordPress Core


Ignore:
Timestamp:
11/24/2025 06:36:59 PM (3 months ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update getID3 to version 1.9.24.

In [60812], two changes related to PHP 8.5 compatibility were cherry picked from the upstream repository to be included in time for WordPress 6.9. Since then, a proper release has been tagged which includes several bug fixes in addition to the previous two changes.

HEIF support has also been added to the Quicktime audio/video module.

A full list of changes can be found on GitHub: https://github.com/JamesHeinrich/getID3/releases/tag/v1.9.24

Reviewed by desrosj, SergeyBiryukov.
Merges [61253] to the 6.9 branch.

Props TobiasBg.
Fixes #64253.

Location:
branches/6.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.9

  • branches/6.9/src/wp-includes/ID3/module.tag.lyrics3.php

    r52254 r61289  
    111111                if (isset($info['lyrics3']['tag_offset_start'])) {
    112112                    $GETID3_ERRORARRAY = &$info['warning'];
    113                     getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
    114                     $getid3_temp = new getID3();
    115                     $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);
    116                     $getid3_apetag = new getid3_apetag($getid3_temp);
    117                     $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
    118                     $getid3_apetag->Analyze();
    119                     if (!empty($getid3_temp->info['ape'])) {
    120                         $info['ape'] = $getid3_temp->info['ape'];
    121                     }
    122                     if (!empty($getid3_temp->info['replay_gain'])) {
    123                         $info['replay_gain'] = $getid3_temp->info['replay_gain'];
    124                     }
    125                     unset($getid3_temp, $getid3_apetag);
     113                    if ($this->getid3->option_tag_apetag) {
     114                        getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
     115                        $getid3_temp = new getID3();
     116                        $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);
     117                        $getid3_apetag = new getid3_apetag($getid3_temp);
     118                        $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
     119                        $getid3_apetag->Analyze();
     120                        if (!empty($getid3_temp->info['ape'])) {
     121                            $info['ape'] = $getid3_temp->info['ape'];
     122                        }
     123                        if (!empty($getid3_temp->info['replay_gain'])) {
     124                            $info['replay_gain'] = $getid3_temp->info['replay_gain'];
     125                        }
     126                        unset($getid3_temp, $getid3_apetag);
     127                    } else {
     128                        $this->warning('Unable to check for Lyrics3 and APE tags interaction since option_tag_apetag=FALSE');
     129                    }
    126130                } else {
    127131                    $this->warning('Lyrics3 and APE tags appear to have become entangled (most likely due to updating the APE tags with a non-Lyrics3-aware tagger)');
     
    228232                            if (strpos($imagestring, '||') !== false) {
    229233                                $imagearray = explode('||', $imagestring);
    230                                 $ParsedLyrics3['images'][$key]['filename']     =                                (isset($imagearray[0]) ? $imagearray[0] : '');
     234                                $ParsedLyrics3['images'][$key]['filename']     =                                $imagearray[0];
    231235                                $ParsedLyrics3['images'][$key]['description']  =                                (isset($imagearray[1]) ? $imagearray[1] : '');
    232236                                $ParsedLyrics3['images'][$key]['timestamp']    = $this->Lyrics3Timestamp2Seconds(isset($imagearray[2]) ? $imagearray[2] : '');
     
    273277    public function Lyrics3Timestamp2Seconds($rawtimestamp) {
    274278        if (preg_match('#^\\[([0-9]{2}):([0-9]{2})\\]$#', $rawtimestamp, $regs)) {
    275             return (int) (($regs[1] * 60) + $regs[2]);
     279            return (int) (((int) $regs[1] * 60) + (int) $regs[2]);
    276280        }
    277281        return false;
     
    288292        foreach ($lyricsarray as $key => $lyricline) {
    289293            $regs = array();
    290             unset($thislinetimestamps);
     294            $thislinetimestamps = array();
    291295            while (preg_match('#^(\\[[0-9]{2}:[0-9]{2}\\])#', $lyricline, $regs)) {
    292296                $thislinetimestamps[] = $this->Lyrics3Timestamp2Seconds($regs[0]);
     
    294298            }
    295299            $notimestamplyricsarray[$key] = $lyricline;
    296             if (isset($thislinetimestamps) && is_array($thislinetimestamps)) {
     300            if (count($thislinetimestamps) > 0) {
    297301                sort($thislinetimestamps);
    298302                foreach ($thislinetimestamps as $timestampkey => $timestamp) {
    299                     if (isset($Lyrics3data['synchedlyrics'][$timestamp])) {
     303                    if (isset($Lyrics3data['comments']['synchedlyrics'][$timestamp])) {
    300304                        // timestamps only have a 1-second resolution, it's possible that multiple lines
    301305                        // could have the same timestamp, if so, append
    302                         $Lyrics3data['synchedlyrics'][$timestamp] .= "\r\n".$lyricline;
     306                        $Lyrics3data['comments']['synchedlyrics'][$timestamp] .= "\r\n".$lyricline;
    303307                    } else {
    304                         $Lyrics3data['synchedlyrics'][$timestamp] = $lyricline;
    305                     }
    306                 }
    307             }
    308         }
    309         $Lyrics3data['unsynchedlyrics'] = implode("\r\n", $notimestamplyricsarray);
    310         if (isset($Lyrics3data['synchedlyrics']) && is_array($Lyrics3data['synchedlyrics'])) {
    311             ksort($Lyrics3data['synchedlyrics']);
     308                        $Lyrics3data['comments']['synchedlyrics'][$timestamp] = $lyricline;
     309                    }
     310                }
     311            }
     312        }
     313        $Lyrics3data['comments']['unsynchedlyrics'][0] = implode("\r\n", $notimestamplyricsarray);
     314        if (isset($Lyrics3data['comments']['synchedlyrics']) && is_array($Lyrics3data['comments']['synchedlyrics'])) {
     315            ksort($Lyrics3data['comments']['synchedlyrics']);
    312316        }
    313317        return true;
Note: See TracChangeset for help on using the changeset viewer.