fix for random numbers

This commit is contained in:
Roland Gruber 2013-11-24 10:04:46 +00:00
parent e972e9d071
commit 1ca279d353
1 changed files with 2 additions and 2 deletions

View File

@ -1111,9 +1111,9 @@ class moduleCache {
*/
function getRandomNumber() {
if (function_exists('openssl_random_pseudo_bytes')) {
return hexdec(bin2hex(openssl_random_pseudo_bytes(5)));
return abs(hexdec(bin2hex(openssl_random_pseudo_bytes(5))));
}
return mt_rand();
return abs(mt_rand());
}
/**