Update to Random_Compat 1.1.5 to fix an issue with older libSodium modules.

Props sarciszewski.
Fixes #35327 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@36220 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2016-01-08 03:27:58 +00:00
parent de5f72567a
commit 9fc247408c
2 changed files with 91 additions and 3 deletions

View File

@@ -58,7 +58,11 @@ if (PHP_VERSION_ID < 70000) {
*/
if (extension_loaded('libsodium')) {
// See random_bytes_libsodium.php
require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
if (PHP_VERSION_ID >= 50300 && function_exists('\\Sodium\\randombytes_buf')) {
require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
} elseif (method_exists('Sodium', 'randombytes_buf')) {
require_once $RandomCompatDIR.'/random_bytes_libsodium_legacy.php';
}
}
if (
!function_exists('random_bytes') &&
@@ -75,8 +79,8 @@ if (PHP_VERSION_ID < 70000) {
// that is not helpful to us here.
// See random_bytes_dev_urandom.php
require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';
}
require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';
}
if (
!function_exists('random_bytes') &&
PHP_VERSION_ID >= 50307 &&