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.
Built from https://develop.svn.wordpress.org/trunk@47737


git-svn-id: http://core.svn.wordpress.org/trunk@47513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2020-05-01 20:12:06 +00:00
parent 791e3bdb38
commit 25c841026d
4 changed files with 8 additions and 10 deletions

View File

@ -114,7 +114,7 @@ class getid3_lib
}
}
// if integers are 64-bit - no other check required
if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) {
if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { // phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound
return true;
}
return false;

View File

@ -285,15 +285,15 @@ class getID3
}
// Check safe_mode off
if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
$this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');
}
if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
// http://php.net/manual/en/mbstring.overload.php
// "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"
// 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.
$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";
$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
}
// check for magic quotes in PHP < 7.4.0 (when these functions became deprecated)
@ -1560,7 +1560,7 @@ class getID3
// page sequence numbers likely happens for OggSpeex and OggFLAC as well, but
// currently vorbiscomment only works on OggVorbis files.
if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
$this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect - error returned: PHP running in Safe Mode (backtick operator not available)');
$this->info[$algorithm.'_data'] = false;

View File

@ -59,8 +59,7 @@ class POP3 {
if(!empty($timeout)) {
settype($timeout,"integer");
$this->TIMEOUT = $timeout;
if (!ini_get('safe_mode'))
set_time_limit($timeout);
set_time_limit($timeout);
}
return true;
}
@ -73,8 +72,7 @@ class POP3 {
}
function update_timer () {
if (!ini_get('safe_mode'))
set_time_limit($this->TIMEOUT);
set_time_limit($this->TIMEOUT);
return true;
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-47736';
$wp_version = '5.5-alpha-47737';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.