Switch to a more secure method for generation of the thread token

This commit is contained in:
Fedor A. Fetisov 2013-09-13 20:18:47 +04:00
parent d9a8afeb57
commit 8bb1551f7a

View File

@ -40,7 +40,7 @@ $kind_to_string = array($kind_user => "user", $kind_agent => "agent", $kind_for_
function next_token()
{
return rand(99999, 99999999);
return function_exists('openssl_random_pseudo_bytes') ? hexdec(bin2hex(openssl_random_pseudo_bytes(4))) : mt_rand(99999, 99999999);
}
function next_revision($link)