Update everything

This commit is contained in:
nikolark committed 2016-05-30 11:30:55 +02:00
1 parent 5da6eca0f6
commit 404c516a94
712 files changed
+44202 -26753

No files matched your search

@@ -48,6 +48,7 @@ function random_bytes($bytes)
'random_bytes(): $bytes must be an integer'
);
}
if ($bytes < 1) {
throw new Error(
'Length must be greater than 0'
@@ -55,14 +56,17 @@ function random_bytes($bytes)
}
$buf = @mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM);
if ($buf !== false) {
if (RandomCompat_strlen($buf) === $bytes) {
/**
* Return our random entropy buffer here:
*/
return $buf;
}
if (
$buf !== false
&&
RandomCompat_strlen($buf) === $bytes
) {
/**
* Return our random entropy buffer here:
*/
return $buf;
}
/**
* If we reach here, PHP has failed us.
*/