Skip to content

Commit 79afb16

Browse files
committedSep 20, 2011
Fix error handling in ldap_get_field_from_username
When successful, ldap_get_entries always returns an array with at least one element inside (the count), so the check for no matches was always successful even when no values were retrieved from LDAP. Fixes #13331
1 parent 50c2a46 commit 79afb16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎core/ldap_api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ function ldap_get_field_from_username( $p_username, $p_field ) {
252252
ldap_unbind( $t_ds );
253253

254254
# If no matches, return null.
255-
if ( count( $t_info ) == 0 ) {
255+
if ( $t_info['count'] == 0 ) {
256256
log_event( LOG_LDAP, "No matches found." );
257257
return null;
258258
}

0 commit comments

Comments
 (0)
Please sign in to comment.