Closed evan361425 closed 1 year ago
At https://github.com/leenooks/phpLDAPadmin/blob/fc7ab06358f4a849a9051561699fce002ca4f643/lib/ds_ldap.php#L1149
is trying to parse hex value. But if the string is not available string, it will show warning:
PHP Deprecated: Invalid characters passed for attempted conversion, these have been ignored in ...
<?php $rdn='OU=\E4\BFD'; preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec('${m[1]}')); }, $rdn);
You can check it first to avoid this problem:
<?php foreach ($dn as $key => $rdn) { if (ctype_xdigit($rdn)) { $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec('${m[1]}')); }, $rdn); } }
relate issue: https://github.com/dompdf/dompdf/issues/2003
Closing this as I'm unable to re-produce this. The regex is pulling 2 chars that are 0-9a-f, which are by definition valid hex and thus valid for chr().
What happen
At https://github.com/leenooks/phpLDAPadmin/blob/fc7ab06358f4a849a9051561699fce002ca4f643/lib/ds_ldap.php#L1149
is trying to parse hex value. But if the string is not available string, it will show warning:
Replay the error
How to solve
You can check it first to avoid this problem:
relate issue: https://github.com/dompdf/dompdf/issues/2003