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/getid3.php

    r60812 r61289  
    388388    protected $startup_warning = '';
    389389
    390     const VERSION           = '1.9.23-202310190849';
     390    const VERSION           = '1.9.24-202509040923';
    391391    const FREAD_BUFFER_SIZE = 32768;
    392392
     
    410410        if (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) {
    411411            // could be stored as "16M" rather than 16777216 for example
    412             $memoryLimit = $matches[1] * 1048576;
     412            $memoryLimit = (int) $matches[1] * 1048576;
    413413        } elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0
    414414            // could be stored as "2G" rather than 2147483648 for example
    415             $memoryLimit = $matches[1] * 1073741824;
     415            $memoryLimit = (int) $matches[1] * 1073741824;
    416416        }
    417417        $this->memory_limit = $memoryLimit;
     
    447447            // Check for magic_quotes_gpc
    448448            if (function_exists('get_magic_quotes_gpc')) {
    449                 if (get_magic_quotes_gpc()) { // @phpstan-ignore-line
     449                if (get_magic_quotes_gpc()) {
    450450                    $this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n";
    451451                }
     
    530530     */
    531531    public function setOption($optArray) {
    532         if (!is_array($optArray) || empty($optArray)) {
     532        if (empty($optArray)) {
    533533            return false;
    534534        }
     
    681681                        throw $e;
    682682                    }
     683                } else {
     684                    $this->warning('skipping check for '.$tag_name.' tags since option_tag_'.$tag_name.'=FALSE');
    683685                }
    684686            }
     
    14771479
    14781480                // Misc other formats
     1481
     1482                // GPX - data         - GPS Exchange Format
     1483                'gpx' => array (
     1484                            'pattern'   => '^<\\?xml [^>]+>[\s]*<gpx ',
     1485                            'group'     => 'misc',
     1486                            'module'    => 'gpx',
     1487                            'mime_type' => 'application/gpx+xml',
     1488                            'fail_id3'  => 'ERROR',
     1489                            'fail_ape'  => 'ERROR',
     1490                        ),
    14791491
    14801492                // PAR2 - data        - Parity Volume Set Specification 2.0
     
    18911903        // Calculate combined bitrate - audio + video
    18921904        $CombinedBitrate  = 0;
    1893         $CombinedBitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0);
    1894         $CombinedBitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0);
     1905        $CombinedBitrate += (isset($this->info['audio']['bitrate']) && ($this->info['audio']['bitrate'] != 'free') ? $this->info['audio']['bitrate'] : 0);
     1906        $CombinedBitrate += (isset($this->info['video']['bitrate'])                                                ? $this->info['video']['bitrate'] : 0);
    18951907        if (($CombinedBitrate > 0) && empty($this->info['bitrate'])) {
    18961908            $this->info['bitrate'] = $CombinedBitrate;
     
    19992011            return false;
    20002012        }
    2001         $this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (!empty($this->info['audio']['bits_per_sample']) ? $this->info['audio']['bits_per_sample'] : 16));
     2013        if ($this->info['audio']['bitrate'] != 'free') {
     2014            $this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (!empty($this->info['audio']['bits_per_sample']) ? $this->info['audio']['bits_per_sample'] : 16));
     2015        }
    20022016
    20032017        if (!empty($this->info['audio']['streams'])) {
Note: See TracChangeset for help on using the changeset viewer.