Make WordPress Core


Ignore:
Timestamp:
01/08/2016 03:27:58 AM (9 years ago)
Author:
dd32
Message:

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

Props sarciszewski.
Fixes #35327 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/random_compat/random.php

    r35922 r36220  
    5959        if (extension_loaded('libsodium')) {
    6060            // See random_bytes_libsodium.php
    61             require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
     61            if (PHP_VERSION_ID >= 50300 && function_exists('\\Sodium\\randombytes_buf')) {
     62                require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
     63            } elseif (method_exists('Sodium', 'randombytes_buf')) {
     64                require_once $RandomCompatDIR.'/random_bytes_libsodium_legacy.php';
     65            }
    6266        }
    6367        if (
     
    7680           
    7781            // See random_bytes_dev_urandom.php
    78             require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';
    79         }
     82                require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';
     83            }
    8084        if (
    8185            !function_exists('random_bytes') &&
Note: See TracChangeset for help on using the changeset viewer.