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


git-svn-id: https://develop.svn.wordpress.org/trunk@35365 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2015-10-23 04:21:01 +00:00
parent b89670b0f6
commit 3a992e266f
11 changed files with 260 additions and 45 deletions

View File

@@ -74,9 +74,11 @@ function random_bytes($bytes)
stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER);
}
}
if (!is_int($bytes)) {
try {
$bytes = RandomCompat_intval($bytes);
} catch (TypeError $ex) {
throw new TypeError(
'Length must be an integer'
'random_bytes(): $bytes must be an integer'
);
}
if ($bytes < 1) {