Fix PHP8 compatibility

This commit is contained in:
Benjamin Renard 2023-07-19 10:26:28 +02:00
parent a6d0f7d126
commit a4319237f2
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -363,10 +363,10 @@ class LSattr_ldap_password extends LSattr_ldap {
*/
public static function getSalt($length=8) {
$pattern = "1234567890abcdefghijklmnopqrstuvwxyz";
$key = $pattern{rand(0,35)};
$key = $pattern[rand(0,35)];
for($i=1;$i<$length;$i++)
{
$key .= $pattern{rand(0,35)};
$key .= $pattern[rand(0,35)];
}
return $key;
}