Fix for issue #103 - hexdec() causes an deprecation notice when invalid chars are used
This commit is contained in:
parent
9fac4b415a
commit
0c334f0385
@ -1146,12 +1146,12 @@ class ldap extends DS {
|
||||
if (is_array($dn)) {
|
||||
$a = array();
|
||||
foreach ($dn as $key => $rdn) {
|
||||
$a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec('${m[1]}')); }, $rdn);
|
||||
$a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec($m[1])); }, $rdn);
|
||||
}
|
||||
return $a;
|
||||
|
||||
} else {
|
||||
return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec('${m[1]}')); }, $dn);
|
||||
return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec($m[1])); }, $dn);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user