Matzewob
Matzewob

Reputation: 19

ADLDAP Curly braces are no longer supported

In a old project that I am migrating I used the old adldap. But now I have to change PHP version and old adldap doesn't work with the error:

HP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /var/www/adLDAP/lib/adLDAP/classes/adLDAPUsers.php on line 764

The code which makes the problem is this:

public function encodePassword($password) {
    $password="\"".$password."\"";
    $encoded="";
    for ($i=0; $i <strlen($password); $i++) { $encoded.="{$password{$i}}\000"; }
    return $encoded;
}

The problem is this line:

for ($i=0; $i <strlen($password); $i++) { $encoded.="{$password{$i}}\000"; }

How can I fix it until I move to new system?

Upvotes: 1

Views: 686

Answers (1)

kovarov
kovarov

Reputation: 792

Change:

$encoded.="{$password{$i}}\000";

To:

$encoded.="{$password[$i]}\000";

Upvotes: 0

Related Questions