lib/LDAP: LdapUtils::explodeDN replace deprecated use of eval in preg_replace
fixes #11490
This commit is contained in:
parent
0edd1b5a08
commit
0f538e7f06
|
@ -28,9 +28,11 @@ class LdapUtils
|
||||||
$res = ldap_explode_dn($dn, $with_type ? 0 : 1);
|
$res = ldap_explode_dn($dn, $with_type ? 0 : 1);
|
||||||
|
|
||||||
foreach ($res as $k => $v) {
|
foreach ($res as $k => $v) {
|
||||||
$res[$k] = preg_replace(
|
$res[$k] = preg_replace_callback(
|
||||||
'/\\\([0-9a-f]{2})/ei',
|
'/\\\([0-9a-f]{2})/i',
|
||||||
"chr(hexdec('\\1'))",
|
function ($m) {
|
||||||
|
return chr(hexdec($m[1]));
|
||||||
|
},
|
||||||
$v
|
$v
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue