DN with non-ASCII chracters displayed incorrect in tree

Bug #1572012 reported by Pavel Khaymi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
phpldapadmin (Ubuntu)
New
Undecided
Unassigned

Bug Description

* 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
                );
        }
}

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.