From db9a2ba2a1be7643c67c4d3238c1157382894bd4 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 19 Apr 2016 20:41:51 +0200 Subject: [PATCH] fix for 32bit systems (179) --- lam/lib/account.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 953c4c9b..d94ab068 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -203,7 +203,7 @@ function generateSalt($len) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890./'; $salt = ''; for ($i = 0; $i < $len; $i++) { - $pos= getRandomNumber() % strlen($chars); + $pos = abs(getRandomNumber() % strlen($chars)); $salt .= $chars{$pos}; } return $salt; @@ -311,7 +311,7 @@ function generateRandomPassword() { for ($x = 0; $x < 10000; $x++) { $password = ''; for ($i = 0; $i < $length; $i++) { - $rand = getRandomNumber() % 65; + $rand = abs(getRandomNumber() % 65); $password .= $list[$rand]; } if (checkPasswordStrength($password, null, null) === true) {