Random_Compat: The version included with 4.4 only supports the PHP 5.2+ namespace version of libsodium, don't attempt to use it with PHP 5.2 or old libsodium versions.

Fixes #35327.

Built from https://develop.svn.wordpress.org/branches/4.4@36257


git-svn-id: http://core.svn.wordpress.org/branches/4.4@36224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2016-01-11 04:38:28 +00:00
parent 3fff7c5e00
commit 9e8fdddea2

View File

@ -56,7 +56,7 @@ if (PHP_VERSION_ID < 70000) {
*
* See ERRATA.md for our reasoning behind this particular order
*/
if (extension_loaded('libsodium')) {
if (PHP_VERSION_ID >= 50300 && extension_loaded('libsodium') && function_exists('\\Sodium\\randombytes_buf')) {
// See random_bytes_libsodium.php
require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
}