- Timestamp:
- 03/08/2016 05:14:52 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/random_compat/random_bytes_openssl.php
r35600 r36886 49 49 ); 50 50 } 51 51 52 if ($bytes < 1) { 52 53 throw new Error( … … 54 55 ); 55 56 } 56 $secure = true; 57 57 58 /** 58 59 * $secure is passed by reference. If it's set to false, fail. Note … … 62 63 * @ref https://github.com/paragonie/random_compat/issues/6#issuecomment-119564973 63 64 */ 65 $secure = true; 64 66 $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; 69 75 } 76 70 77 /** 71 78 * If we reach here, PHP has failed us.
Note: See TracChangeset
for help on using the changeset viewer.