Make WordPress Core


Ignore:
Timestamp:
10/04/2022 02:06:29 AM (2 years ago)
Author:
desrosj
Message:

External Libraries: Update getID3 to version 1.9.22.

This updates the getID3 library from version 1.9.21 to 1.9.22, which contains a number of bug fixes and improvements to PHP 8.1 support.

A full list of changes can be found on GitHub: https://github.com/JamesHeinrich/getID3/compare/v1.9.21...v1.9.22.

Props jrf, desrosj.
Fixes #56692.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ID3/getid3.php

    r52254 r54376  
    183183
    184184    /**
    185      * Use MD5 of source file if availble - only FLAC and OptimFROG
     185     * Use MD5 of source file if available - only FLAC and OptimFROG
    186186     *
    187187     * @var bool
     
    388388    protected $startup_warning = '';
    389389
    390     const VERSION           = '1.9.21-202109171300';
     390    const VERSION           = '1.9.22-202207161647';
    391391    const FREAD_BUFFER_SIZE = 32768;
    392392
     
    394394    const ATTACHMENTS_INLINE = true;
    395395
     396    /**
     397     * @throws getid3_exception
     398     */
    396399    public function __construct() {
    397400
     
    570573
    571574            // remote files not supported
    572             if (preg_match('#^(ht|f)tp://#', $filename)) {
     575            if (preg_match('#^(ht|f)tps?://#', $filename)) {
    573576                throw new getid3_exception('Remote files are not supported - please copy the file locally first');
    574577            }
     
    10561059                        ),
    10571060
    1058 // has been known to produce false matches in random files (e.g. JPEGs), leave out until more precise matching available
    1059 //              // MOD  - audio       - MODule (assorted sub-formats)
    1060 //              'mod'  => array(
    1061 //                          'pattern'   => '^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)',
    1062 //                          'group'     => 'audio',
    1063 //                          'module'    => 'mod',
    1064 //                          'option'    => 'mod',
    1065 //                          'mime_type' => 'audio/mod',
    1066 //                      ),
     1061
     1062                // MOD  - audio       - MODule (SoundTracker)
     1063                'mod'  => array(
     1064                            //'pattern'   => '^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)', // has been known to produce false matches in random files (e.g. JPEGs), leave out until more precise matching available
     1065                            'pattern'   => '^.{1080}(M\\.K\\.)',
     1066                            'group'     => 'audio',
     1067                            'module'    => 'mod',
     1068                            'option'    => 'mod',
     1069                            'mime_type' => 'audio/mod',
     1070                        ),
    10671071
    10681072                // MOD  - audio       - MODule (Impulse Tracker)
     
    10951099                // MPC  - audio       - Musepack / MPEGplus
    10961100                'mpc'  => array(
    1097                             'pattern'   => '^(MPCK|MP\\+|[\\x00\\x01\\x10\\x11\\x40\\x41\\x50\\x51\\x80\\x81\\x90\\x91\\xC0\\xC1\\xD0\\xD1][\\x20-\\x37][\\x00\\x20\\x40\\x60\\x80\\xA0\\xC0\\xE0])',
     1101                            'pattern'   => '^(MPCK|MP\\+)',
    10981102                            'group'     => 'audio',
    10991103                            'module'    => 'mpc',
     
    15501554            $GetFileFormatArray = $this->GetFileFormatArray();
    15511555            $info = $GetFileFormatArray['mp3'];
     1556            $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php';
     1557            return $info;
     1558        } elseif (preg_match('#\\.mp[cp\\+]$#i', $filename) && preg_match('#[\x00\x01\x10\x11\x40\x41\x50\x51\x80\x81\x90\x91\xC0\xC1\xD0\xD1][\x20-37][\x00\x20\x40\x60\x80\xA0\xC0\xE0]#s', $filedata)) {
     1559            // old-format (SV4-SV6) Musepack header that has a very loose pattern match and could falsely match other data (e.g. corrupt mp3)
     1560            // only enable this pattern check if the filename ends in .mpc/mpp/mp+
     1561            $GetFileFormatArray = $this->GetFileFormatArray();
     1562            $info = $GetFileFormatArray['mpc'];
    15521563            $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php';
    15531564            return $info;
     
    21992210            return substr($this->data_string, $this->data_string_position - $bytes, $bytes);
    22002211        }
     2212        if ($bytes == 0) {
     2213            return '';
     2214        } elseif ($bytes < 0) {
     2215            throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().')', 10);
     2216        }
    22012217        $pos = $this->ftell() + $bytes;
    22022218        if (!getid3_lib::intValueSupported($pos)) {
Note: See TracChangeset for help on using the changeset viewer.