From 7753eb4a7bf2d6bc69a35f5b0e21d8e835f086cc Mon Sep 17 00:00:00 2001 From: Rickiewars Date: Fri, 3 Sep 2021 11:58:11 +0200 Subject: [PATCH] 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. --- www/includes/web_functions.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/includes/web_functions.inc.php b/www/includes/web_functions.inc.php index 1548d4f..46fcadb 100644 --- a/www/includes/web_functions.inc.php +++ b/www/includes/web_functions.inc.php @@ -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); }