Make WordPress Core


Ignore:
Timestamp:
10/20/2023 01:27:56 PM (3 years ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update getID3 to version 1.9.23.

The latest version includes numerous bug fixes, a few new features, as well as various improvements for PHP 8.1 and PHP 8.2 support.

This commit also includes PHPCS adjustments previously made for a passing PHP Compatibility scan.

References:

Follow-up to [47601], [48278], [52254], [54376].

Props jrf.
Fixes #59683.

File:
1 edited

Legend:

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

    r54376 r56975  
    388388        protected $startup_warning = '';
    389389
    390         const VERSION           = '1.9.22-202207161647';
     390        const VERSION           = '1.9.23-202310190849';
    391391        const FREAD_BUFFER_SIZE = 32768;
    392392
     
    439439                }
    440440
    441                 // check for magic quotes in PHP < 7.4.0 (when these functions became deprecated)
    442                 if (version_compare(PHP_VERSION, '7.4.0', '<')) {
     441                // check for magic quotes in PHP < 5.4.0 (when these options were removed and getters always return false)
     442                if (version_compare(PHP_VERSION, '5.4.0', '<')) {
    443443                        // Check for magic_quotes_runtime
    444444                        if (function_exists('get_magic_quotes_runtime')) {
    445445                                // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
    446                                 if (get_magic_quotes_runtime()) {
     446                                if (get_magic_quotes_runtime()) { // @phpstan-ignore-line
    447447                                        $this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n";
    448448                                }
     
    451451                        if (function_exists('get_magic_quotes_gpc')) {
    452452                                // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated
    453                                 if (get_magic_quotes_gpc()) {
     453                                if (get_magic_quotes_gpc()) { // @phpstan-ignore-line
    454454                                        $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";
    455455                                }
     
    14651465                                                        'module'    => 'xz',
    14661466                                                        'mime_type' => 'application/x-xz',
     1467                                                        'fail_id3'  => 'ERROR',
     1468                                                        'fail_ape'  => 'ERROR',
     1469                                                ),
     1470
     1471                                // XZ   - data         - XZ compressed data
     1472                                '7zip'  => array(
     1473                                                        'pattern'   => '^7z\\xBC\\xAF\\x27\\x1C',
     1474                                                        'group'     => 'archive',
     1475                                                        'module'    => '7zip',
     1476                                                        'mime_type' => 'application/x-7z-compressed',
    14671477                                                        'fail_id3'  => 'ERROR',
    14681478                                                        'fail_ape'  => 'ERROR',
     
    19831993                $BitrateUncompressed = $this->info['video']['resolution_x'] * $this->info['video']['resolution_y'] * $this->info['video']['bits_per_sample'] * $FrameRate;
    19841994
    1985                 $this->info['video']['compression_ratio'] = $BitrateCompressed / $BitrateUncompressed;
     1995                $this->info['video']['compression_ratio'] = getid3_lib::SafeDiv($BitrateCompressed, $BitrateUncompressed, 1);
    19861996                return true;
    19871997        }
     
    21892199
    21902200        /**
     2201         * @phpstan-impure
     2202         *
    21912203         * @return int|bool
    21922204         */
     
    22002212        /**
    22012213         * @param int $bytes
     2214         *
     2215         * @phpstan-impure
    22022216         *
    22032217         * @return string|false
     
    22462260         * @param int $whence
    22472261         *
     2262         * @phpstan-impure
     2263         *
    22482264         * @return int
    22492265         *
     
    22872303
    22882304        /**
     2305         * @phpstan-impure
     2306         *
    22892307         * @return string|false
    22902308         *
     
    23422360
    23432361        /**
     2362         * @phpstan-impure
     2363         *
    23442364         * @return bool
    23452365         */
Note: See TracChangeset for help on using the changeset viewer.