removed mcrypt_create_iv func

This commit is contained in:
Miroslav Šedivý 2019-12-22 22:58:11 +01:00
parent 5423b4b11b
commit 7352ac53a6

View file

@ -3,8 +3,8 @@ include 'common.php';
// Create token
if(empty($_SESSION['token'])){
if(function_exists('mcrypt_create_iv')){
$_SESSION['token'] = bin2hex(mcrypt_create_iv(5, MCRYPT_DEV_URANDOM));
if(function_exists('random_bytes')){
$_SESSION['token'] = bin2hex(random_bytes(5));
} else {
$_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(5));
}