WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/08/2016 05:14:52 PM (6 years ago)
Author:
ocean90
Message:

Update Random_Compat from 1.1.6 to 1.2.1.

Changes: https://github.com/paragonie/random_compat/compare/1.1.6...v1.2.1

See #35665.

File:
1 edited

Legend:

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

    r35600 r36886  
    4949        );
    5050    }
     51
    5152    if ($bytes < 1) {
    5253        throw new Error(
     
    5657
    5758    $buf = @mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM);
    58     if ($buf !== false) {
    59         if (RandomCompat_strlen($buf) === $bytes) {
    60             /**
    61              * Return our random entropy buffer here:
    62              */
    63             return $buf;
    64         }
     59    if (
     60        $buf !== false
     61        &&
     62        RandomCompat_strlen($buf) === $bytes
     63    ) {
     64        /**
     65         * Return our random entropy buffer here:
     66         */
     67        return $buf;
    6568    }
     69
    6670    /**
    6771     * If we reach here, PHP has failed us.
Note: See TracChangeset for help on using the changeset viewer.