From 0c334f0385880d8c8bdfedd01f37a9cd30f4caa4 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 19 Sep 2020 17:09:29 +1000 Subject: [PATCH] Fix for issue #103 - hexdec() causes an deprecation notice when invalid chars are used --- lib/ds_ldap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ds_ldap.php b/lib/ds_ldap.php index fa84aed..76d3467 100644 --- a/lib/ds_ldap.php +++ b/lib/ds_ldap.php @@ -1146,12 +1146,12 @@ class ldap extends DS { 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('${m[1]}')); }, $rdn); + $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec($m[1])); }, $rdn); } return $a; } else { - return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec('${m[1]}')); }, $dn); + return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return chr(hexdec($m[1])); }, $dn); } }