mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 00:14:40 +03:00
Switch to a more secure method for generation of the CSRF token
This commit is contained in:
parent
2334a0ed0a
commit
d7c18215c5
@ -755,7 +755,7 @@ function print_csrf_token_in_url()
|
||||
function setcsrftoken()
|
||||
{
|
||||
if (!isset($_SESSION['csrf_token'])) {
|
||||
$_SESSION['csrf_token'] = sha1(rand(10000000, 99999999));
|
||||
$_SESSION['csrf_token'] = sha1(session_id() . (function_exists('openssl_random_pseudo_bytes') ? openssl_random_pseudo_bytes(32) : (time() + microtime()) . mt_rand(0, 99999999)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user