Changed preg_replace to preg_replace callback
This commit is contained in:
parent
e673df3ba8
commit
b082cf1742
@ -2565,12 +2565,22 @@ function dn_unescape($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 ($r) {
|
||||||
|
return "''.chr(hexdec('$r[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 ($r) {
|
||||||
|
return "''.chr(hexdec('$r[1]')).''";
|
||||||
|
},
|
||||||
|
$dn
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user