I just wanted to document this fix because I know it can be annoying when testing/debugging. For those of you that are trying to use the older adLDAP library with newer versions of PHP, the following warning will often occur.
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in lib\adLDAP\classes\adLDAPUtils.php on line 105
To fix this, navigate to the adLDAP\classes\adLDAPUtils.php file and modify the following:
Line: 102
public function ldapSlashes($str){
return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e',
'"\\\\\".join("",unpack("H2","$1"))',
$str);
}
Change to this:
public function ldapSlashes($str){
return preg_replace_callback('/([\x00-\x1F\*\(\)\\\\])/',
function($matches) {
foreach($matches as $match) {
return join("", unpack("H2","$1"));
}
}, $str
);
}
I just wanted to document this fix because I know it can be annoying when testing/debugging. For those of you that are trying to use the older adLDAP library with newer versions of PHP, the following warning will often occur.
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in lib\adLDAP\classes\adLDAPUtils.php on line 105To fix this, navigate to the adLDAP\classes\adLDAPUtils.php file and modify the following:
Line: 102
Change to this: