DN with non-ASCII chracters displayed incorrect in tree

Bug #1572012 reported by Pavel Khaymi on 2016-04-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
phpldapadmin (Ubuntu)
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  Edit
Everyone can see this information.

Other bug subscribers