mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-05-30 12:34:05 +02:00
random_bytes() only for >PHP7 (#1066)
This commit is contained in:
parent
f380478197
commit
eb8f3d80bc
|
@ -245,7 +245,11 @@ if (defined('FM_EMBED')) {
|
||||||
|
|
||||||
//Generating CSRF Token
|
//Generating CSRF Token
|
||||||
if (empty($_SESSION['token'])) {
|
if (empty($_SESSION['token'])) {
|
||||||
|
if (function_exists('random_bytes')) {
|
||||||
$_SESSION['token'] = bin2hex(random_bytes(32));
|
$_SESSION['token'] = bin2hex(random_bytes(32));
|
||||||
|
} else {
|
||||||
|
$_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($auth_users)) {
|
if (empty($auth_users)) {
|
||||||
|
|
Loading…
Reference in a new issue