@@ -351,7 +351,7 @@ public function searchfordn(
351351 string $ scope = 'subtree '
352352 ): ?string {
353353 // Traverse all search bases, returning DN if found
354- $ bases = Utils \Arrays:: arrayize ($ base );
354+ $ bases = is_array ($ base ) ? $ base : [ $ base ] ;
355355 foreach ($ bases as $ current ) {
356356 try {
357357 // Single base search
@@ -373,8 +373,9 @@ public function searchfordn(
373373 return null ;
374374 } else {
375375 // Zero hits not allowed
376+ $ attributes = is_array ($ attribute ) ? $ attribute : [$ attribute ];
376377 throw $ this ->makeException ('Library - LDAP searchfordn(): LDAP search returned zero entries for ' .
377- ' filter \'( ' . join (' | ' , Utils \Arrays:: arrayize ( $ attribute ) ) .
378+ ' filter \'( ' . join (' | ' , $ attributes ) .
378379 ' = ' . $ value . ') \' on base(s) \'( ' . join (' & ' , $ bases ) . ') \'' , 2 );
379380 }
380381 }
@@ -435,7 +436,7 @@ public function searchformultiple(
435436 throw $ this ->makeException ('ldap:LdapConnection->search_manual : No base DNs were passed ' , ERR_INTERNAL );
436437 }
437438
438- $ attributes = Utils \Arrays:: arrayize ($ attributes );
439+ $ attributes = is_array ($ attributes ) ? $ attributes : [ $ attributes ] ;
439440
440441 // Search each base until result is found
441442 $ result = false ;
@@ -755,7 +756,7 @@ public function validate(array $config, string $username, string $password = nul
755756 public static function escapeFilterValue ($ values = [], bool $ singleValue = true )
756757 {
757758 // Parameter validation
758- $ values = Utils \Arrays:: arrayize ($ values );
759+ $ values = is_array ($ values ) ? $ values : [ $ values ] ;
759760
760761 foreach ($ values as $ key => $ val ) {
761762 if ($ val === null ) {
0 commit comments