Make WordPress Core


Ignore:
Timestamp:
04/20/2020 11:11:48 AM (5 years ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update getID3() to 1.9.19.

Changelog: https://github.com/JamesHeinrich/getID3/compare/v1.9.18...v1.9.19

Props ayeshrajans, schlessera.
See #49945.

File:
1 edited

Legend:

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

    r46586 r47601  
    251251    protected $startup_warning = '';
    252252
    253     const VERSION           = '1.9.18-201907240906';
     253    const VERSION           = '1.9.19-201912131005';
    254254    const FREAD_BUFFER_SIZE = 32768;
    255255
     
    267267
    268268        // Check memory
    269         $this->memory_limit = ini_get('memory_limit');
    270         if (preg_match('#([0-9]+) ?M#i', $this->memory_limit, $matches)) {
     269        $memoryLimit = ini_get('memory_limit');
     270        if (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) {
    271271            // could be stored as "16M" rather than 16777216 for example
    272             $this->memory_limit = $matches[1] * 1048576;
    273         } elseif (preg_match('#([0-9]+) ?G#i', $this->memory_limit, $matches)) { // The 'G' modifier is available since PHP 5.1.0
     272            $memoryLimit = $matches[1] * 1048576;
     273        } elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0
    274274            // could be stored as "2G" rather than 2147483648 for example
    275             $this->memory_limit = $matches[1] * 1073741824;
    276         }
     275            $memoryLimit = $matches[1] * 1073741824;
     276        }
     277        $this->memory_limit = $memoryLimit;
     278
    277279        if ($this->memory_limit <= 0) {
    278280            // memory limits probably disabled
     
    288290        }
    289291
    290         if (($mbstring_func_overload = ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
     292        if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
    291293            // http://php.net/manual/en/mbstring.overload.php
    292294            // "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions"
     
    295297        }
    296298
    297         // WORDPRESS CHANGE FROM UPSTREAM
    298         // Comment out deprecated function
    299         /*
    300         // Check for magic_quotes_runtime
    301         if (function_exists('get_magic_quotes_runtime')) {
    302             if (get_magic_quotes_runtime()) {
    303                 $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";
    304             }
    305         }
    306 
    307         // Check for magic_quotes_gpc
    308         if (function_exists('magic_quotes_gpc')) {
    309             if (get_magic_quotes_gpc()) {
    310                 $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";
    311             }
    312         }
    313         **/
     299        // check for magic quotes in PHP < 7.4.0 (when these functions became deprecated)
     300        if (version_compare(PHP_VERSION, '7.4.0', '<')) {
     301            // Check for magic_quotes_runtime
     302            if (function_exists('get_magic_quotes_runtime')) {
     303                if (get_magic_quotes_runtime()) {
     304                    $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";
     305                }
     306            }
     307            // Check for magic_quotes_gpc
     308            if (function_exists('get_magic_quotes_gpc')) {
     309                if (get_magic_quotes_gpc()) {
     310                    $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";
     311                }
     312            }
     313        }
    314314
    315315        // Load support library
     
    403403
    404404    /**
    405      * @param string $filename
    406      * @param int    $filesize
     405     * @param string   $filename
     406     * @param int      $filesize
     407     * @param resource $fp
    407408     *
    408409     * @return bool
     
    514515     * analyze file
    515516     *
    516      * @param string $filename
    517      * @param int    $filesize
    518      * @param string $original_filename
     517     * @param string   $filename
     518     * @param int      $filesize
     519     * @param string   $original_filename
     520     * @param resource $fp
    519521     *
    520522     * @return array
     
    11051107                            'module'    => 'ts',
    11061108                            'mime_type' => 'video/MP2T',
     1109                        ),
     1110
     1111                // WTV - audio/video - Windows Recorded TV Show
     1112                'wtv' => array(
     1113                            'pattern'   => '^\\xB7\\xD8\\x00\\x20\\x37\\x49\\xDA\\x11\\xA6\\x4E\\x00\\x07\\xE9\\x5E\\xAD\\x8D',
     1114                            'group'     => 'audio-video',
     1115                            'module'    => 'wtv',
     1116                            'mime_type' => 'video/x-ms-wtv',
    11071117                        ),
    11081118
     
    15291539            default:
    15301540                return $this->error('bad algorithm "'.$algorithm.'" in getHashdata()');
    1531                 break;
    15321541        }
    15331542
Note: See TracChangeset for help on using the changeset viewer.