ALPHA 3.0.2

This commit is contained in:
TheGamecraft
2018-09-05 11:35:41 -04:00
parent 4dbdc8fd19
commit 8ef8057bfa
771 changed files with 9284 additions and 5857 deletions

View File

@@ -42,6 +42,7 @@ if (!is_callable('random_bytes')) {
function random_bytes($bytes)
{
try {
/** @var int $bytes */
$bytes = RandomCompat_intval($bytes);
} catch (TypeError $ex) {
throw new TypeError(
@@ -55,10 +56,11 @@ if (!is_callable('random_bytes')) {
);
}
$buf = @mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM);
/** @var string|bool $buf */
$buf = @mcrypt_create_iv((int) $bytes, (int) MCRYPT_DEV_URANDOM);
if (
$buf !== false
&&
is_string($buf)
&&
RandomCompat_strlen($buf) === $bytes
) {
/**