Make WordPress Core


Ignore:
Timestamp:
10/23/2015 04:21:01 AM (10 years ago)
Author:
dd32
Message:

Update to Random_Compat 1.0.9.
This update includes fixes for Windows support & libSodium support, and removes the Throwable Polyfill due to PHP7 incompatibilities.

Fixes #28633

File:
1 edited

Legend:

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

    r34922 r35365  
    4242function random_bytes($bytes)
    4343{
    44     if (!is_int($bytes)) {
     44    try {
     45        $bytes = RandomCompat_intval($bytes);
     46    } catch (TypeError $ex) {
    4547        throw new TypeError(
    46             'Length must be an integer'
     48            'random_bytes(): $bytes must be an integer'
    4749        );
    4850    }
     
    5355    }
    5456
    55     $buf = mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM);
     57    $buf = @mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM);
    5658    if ($buf !== false) {
    5759        if (RandomCompat_strlen($buf) === $bytes) {
Note: See TracChangeset for help on using the changeset viewer.