Comment 0 for bug 1572012

Revision history for this message
Pavel Khaymi (tenebras609) wrote :

* phpldapadmin 1.2.2-5.2ubuntu2

lib/functions.php:2544 function dn_unescape($dn) use wrong arguments in preg_replace_callback()

function dn_unescape($dn) {
        if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
                debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);

        if (is_array($dn)) {
                $a = array();

                foreach ($dn as $key => $rdn) {
                        $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
                                function ($m) {
- return ''.chr(hexdec('\\1')).'';
+ return ''.chr(hexdec($m[0])).'';
                                },
                                $rdn
                        );
                }

                return $a;

        } else {
                 return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
                         function ($m) {
- return ''.chr(hexdec('\\1')).'';
- return ''.chr(hexdec($m[0])).'';
                        },
                        $dn
                );
        }
}