mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Update Random_Compat to master.
This update mostly concerns OpenSSL being unusable on PHP 5.3~5.3.3. See #28633, #34409 Built from https://develop.svn.wordpress.org/trunk@35410 git-svn-id: http://core.svn.wordpress.org/trunk@35374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3def1c5014
commit
82d034a386
@ -30,16 +30,16 @@ if (!defined('PHP_VERSION_ID')) {
|
||||
// This constant was introduced in PHP 5.2.7
|
||||
$RandomCompatversion = explode('.', PHP_VERSION);
|
||||
define('PHP_VERSION_ID', ($RandomCompatversion[0] * 10000 + $RandomCompatversion[1] * 100 + $RandomCompatversion[2]));
|
||||
unset($RandomCompatversion);
|
||||
$RandomCompatversion = null;
|
||||
}
|
||||
if (PHP_VERSION_ID < 70000) {
|
||||
if (!defined('RANDOM_COMPAT_READ_BUFFER')) {
|
||||
define('RANDOM_COMPAT_READ_BUFFER', 8);
|
||||
}
|
||||
$__DIR__ = dirname(__FILE__);
|
||||
require_once $__DIR__.'/byte_safe_strings.php';
|
||||
require_once $__DIR__.'/cast_to_int.php';
|
||||
require_once $__DIR__.'/error_polyfill.php';
|
||||
$RandomCompatDIR = dirname(__FILE__);
|
||||
require_once $RandomCompatDIR.'/byte_safe_strings.php';
|
||||
require_once $RandomCompatDIR.'/cast_to_int.php';
|
||||
require_once $RandomCompatDIR.'/error_polyfill.php';
|
||||
if (!function_exists('random_bytes')) {
|
||||
/**
|
||||
* PHP 5.2.0 - 5.6.x way to implement random_bytes()
|
||||
@ -58,7 +58,7 @@ if (PHP_VERSION_ID < 70000) {
|
||||
*/
|
||||
if (extension_loaded('libsodium')) {
|
||||
// See random_bytes_libsodium.php
|
||||
require_once $__DIR__.'/random_bytes_libsodium.php';
|
||||
require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
|
||||
}
|
||||
if (
|
||||
!function_exists('random_bytes') &&
|
||||
@ -75,7 +75,7 @@ if (PHP_VERSION_ID < 70000) {
|
||||
// that is not helpful to us here.
|
||||
|
||||
// See random_bytes_dev_urandom.php
|
||||
require_once $__DIR__.'/random_bytes_dev_urandom.php';
|
||||
require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';
|
||||
}
|
||||
if (
|
||||
!function_exists('random_bytes') &&
|
||||
@ -83,7 +83,7 @@ if (PHP_VERSION_ID < 70000) {
|
||||
extension_loaded('mcrypt')
|
||||
) {
|
||||
// See random_bytes_mcrypt.php
|
||||
require_once $__DIR__.'/random_bytes_mcrypt.php';
|
||||
require_once $RandomCompatDIR.'/random_bytes_mcrypt.php';
|
||||
}
|
||||
if (
|
||||
!function_exists('random_bytes') &&
|
||||
@ -94,20 +94,28 @@ if (PHP_VERSION_ID < 70000) {
|
||||
$RandomCompatCOMtest = new COM('CAPICOM.Utilities.1');
|
||||
if (method_exists($RandomCompatCOMtest, 'GetRandom')) {
|
||||
// See random_bytes_com_dotnet.php
|
||||
require_once $__DIR__.'/random_bytes_com_dotnet.php';
|
||||
require_once $RandomCompatDIR.'/random_bytes_com_dotnet.php';
|
||||
}
|
||||
} catch (com_exception $e) {
|
||||
// Don't try to use it.
|
||||
}
|
||||
unset($RandomCompatCOMtest);
|
||||
$RandomCompatCOMtest = null;
|
||||
}
|
||||
if (
|
||||
!function_exists('random_bytes') &&
|
||||
extension_loaded('openssl') &&
|
||||
PHP_VERSION_ID >= 50300
|
||||
(
|
||||
// Unix-like with PHP >= 5.3.0 or
|
||||
(
|
||||
DIRECTORY_SEPARATOR === '/' &&
|
||||
PHP_VERSION_ID >= 50300
|
||||
) ||
|
||||
// Windows with PHP >= 5.3.4
|
||||
PHP_VERSION_ID >= 50304
|
||||
)
|
||||
) {
|
||||
// See random_bytes_openssl.php
|
||||
require_once $__DIR__.'/random_bytes_openssl.php';
|
||||
require_once $RandomCompatDIR.'/random_bytes_openssl.php';
|
||||
}
|
||||
if (!function_exists('random_bytes')) {
|
||||
/**
|
||||
@ -123,7 +131,7 @@ if (PHP_VERSION_ID < 70000) {
|
||||
}
|
||||
}
|
||||
if (!function_exists('random_int')) {
|
||||
require_once $__DIR__.'/random_int.php';
|
||||
require_once $RandomCompatDIR.'/random_int.php';
|
||||
}
|
||||
unset($__DIR__);
|
||||
$RandomCompatDIR = null;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-beta1-35409';
|
||||
$wp_version = '4.4-beta1-35410';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user