]> granicus.if.org Git - php/commitdiff
@- Made ldap_get_entries() return an array even if there are no entries
authorfoobar <sniper@php.net>
Mon, 4 Dec 2000 17:07:27 +0000 (17:07 +0000)
committerfoobar <sniper@php.net>
Mon, 4 Dec 2000 17:07:27 +0000 (17:07 +0000)
   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

ext/ldap/ldap.c

index 989b2bce6ef15bfbcd6c1ff4c62eeb84e4eff6b6..914def184a6c2b8f4333ddef8084d6cde0f5d2a5 100644 (file)
@@ -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;