Make WordPress Core


Ignore:
Timestamp:
03/08/2016 05:14:52 PM (9 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_openssl.php

    r35600 r36886  
    4949        );
    5050    }
     51
    5152    if ($bytes < 1) {
    5253        throw new Error(
     
    5455        );
    5556    }
    56     $secure = true;
     57
    5758    /**
    5859     * $secure is passed by reference. If it's set to false, fail. Note
     
    6263     * @ref https://github.com/paragonie/random_compat/issues/6#issuecomment-119564973
    6364     */
     65    $secure = true;
    6466    $buf = openssl_random_pseudo_bytes($bytes, $secure);
    65     if ($buf !== false && $secure) {
    66         if (RandomCompat_strlen($buf) === $bytes) {
    67             return $buf;
    68         }
     67    if (
     68        $buf !== false
     69        &&
     70        $secure
     71        &&
     72        RandomCompat_strlen($buf) === $bytes
     73    ) {
     74        return $buf;
    6975    }
     76
    7077    /**
    7178     * If we reach here, PHP has failed us.
Note: See TracChangeset for help on using the changeset viewer.