Make WordPress Core

Changeset 47737


Ignore:
Timestamp:
05/01/2020 08:10:58 PM (5 years ago)
Author:
desrosj
Message:

General: More PHP compatibility adjustments.

In this round:

  • Removed references to safe_mode in class-php3.php. This was removed in PHP 5.4.
  • Add inline exclude comments for compatibility checks in getID3.

Follow up of [47735-47736].

See #49922.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r47601 r47737  
    115115        }
    116116        // if integers are 64-bit - no other check required
    117         if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) {
     117        if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { // phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound
    118118            return true;
    119119        }
  • trunk/src/wp-includes/ID3/getid3.php

    r47736 r47737  
    286286
    287287        // Check safe_mode off
    288         if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
     288        if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
    289289            $this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');
    290290        }
    291291
    292         if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
     292        if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
    293293            // http://php.net/manual/en/mbstring.overload.php
    294294            // "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"
    295295            // getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those.
    296             $this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n";
     296            $this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n"; // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
    297297        }
    298298
     
    15611561            // currently vorbiscomment only works on OggVorbis files.
    15621562
    1563             if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
     1563            if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
    15641564
    15651565                $this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect - error returned: PHP running in Safe Mode (backtick operator not available)');
  • trunk/src/wp-includes/class-pop3.php

    r45730 r47737  
    6060            settype($timeout,"integer");
    6161            $this->TIMEOUT = $timeout;
    62             if (!ini_get('safe_mode'))
    63                 set_time_limit($timeout);
     62            set_time_limit($timeout);
    6463        }
    6564        return true;
     
    7473
    7574    function update_timer () {
    76         if (!ini_get('safe_mode'))
    77             set_time_limit($this->TIMEOUT);
     75        set_time_limit($this->TIMEOUT);
    7876        return true;
    7977    }
Note: See TracChangeset for help on using the changeset viewer.