Reputation: 19
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
Reputation: 792
Change:
$encoded.="{$password{$i}}\000";
To:
$encoded.="{$password[$i]}\000";
Upvotes: 0