Update web_functions.inc.php (#117)

Fix for issue #115

Added typecast to int that fixes a fatal error telling that the second argument of rand() expects an int but a float is given on an ARMv7 architecture.
Problem seems to be introduced in PHP v8.
This commit is contained in:
Rickiewars 2021-09-03 11:58:11 +02:00 committed by GitHub
parent 1f4ab9e1f0
commit 7753eb4a7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,9 +49,9 @@ validate_passkey_cookie();
function generate_passkey() {
$rnd1 = rand(10000000,100000000000);
$rnd2 = rand(10000000,100000000000);
$rnd3 = rand(10000000,100000000000);
$rnd1 = rand(10000000, (int)100000000000);
$rnd2 = rand(10000000, (int)100000000000);
$rnd3 = rand(10000000, (int)100000000000);
return sprintf("%0x",$rnd1) . sprintf("%0x",$rnd2) . sprintf("%0x",$rnd3);
}