lib/LDAP: LdapUtils::explodeDN replace deprecated use of eval in preg_replace

fixes #11490
This commit is contained in:
Markus Frosch 2016-03-31 12:59:35 +02:00 committed by Eric Lippmann
parent 0edd1b5a08
commit 0f538e7f06
1 changed files with 5 additions and 3 deletions

View File

@ -28,9 +28,11 @@ class LdapUtils
$res = ldap_explode_dn($dn, $with_type ? 0 : 1);
foreach ($res as $k => $v) {
$res[$k] = preg_replace(
'/\\\([0-9a-f]{2})/ei',
"chr(hexdec('\\1'))",
$res[$k] = preg_replace_callback(
'/\\\([0-9a-f]{2})/i',
function ($m) {
return chr(hexdec($m[1]));
},
$v
);
}