Merge pull request #3 from bchavet/master
Use preg_replace_callback instead of /e in preg_replace
This commit is contained in:
commit
d2a800878f
@ -1116,13 +1116,14 @@ class ldap extends DS {
|
|||||||
|
|
||||||
if (is_array($dn)) {
|
if (is_array($dn)) {
|
||||||
$a = array();
|
$a = array();
|
||||||
foreach ($dn as $key => $rdn)
|
foreach ($dn as $key => $rdn) {
|
||||||
$a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn);
|
$a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return "''.chr(hexdec('${m[1]}')).''"; }, $rdn);
|
||||||
|
}
|
||||||
return $a;
|
return $a;
|
||||||
|
|
||||||
} else
|
} else {
|
||||||
return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn);
|
return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return "''.chr(hexdec('${m[1]}')).''"; }, $dn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRootDSE($method=null) {
|
public function getRootDSE($method=null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user