Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4080786

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 6a1760b commit 4080786

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
@@ -241,7 +241,7 @@ function ldap_get_field_from_username( $p_username, $p_field ) {
241241
ldap_unbind( $t_ds );
242242

243243
# If no matches, return null.
244-
if ( count( $t_info ) == 0 ) {
244+
if ( $t_info['count'] == 0 ) {
245245
log_event( LOG_LDAP, "No matches found." );
246246
return null;
247247
}

0 commit comments

Comments
 (0)
Please sign in to comment.