From: foobar Date: Mon, 4 Dec 2000 17:07:27 +0000 (+0000) Subject: @- Made ldap_get_entries() return an array even if there are no entries X-Git-Tag: php-4.0.5RC1~1023 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f48c0fbc9542e1e22aece92d35c7de15cc2f8d96;p=php @- Made ldap_get_entries() return an array even if there are no entries in search result. (Jani) # This was actually the original behaviour and the correct one. # I messed it up when I fixed another bug in it a while ago.. # Fixes bug #8054 --- diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 989b2bce6e..914def184a 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -851,11 +851,13 @@ PHP_FUNCTION(ldap_get_entries) if (ldap_result == NULL) RETURN_FALSE; num_entries = ldap_count_entries(ldap, ldap_result); - if (num_entries == 0) RETURN_FALSE; array_init(return_value); - + add_assoc_long(return_value, "count", num_entries); + + if (num_entries == 0) return; num_entries = 0; + ldap_result_entry = ldap_first_entry(ldap, ldap_result); if (ldap_result_entry == NULL) RETURN_FALSE;