From f48c0fbc9542e1e22aece92d35c7de15cc2f8d96 Mon Sep 17 00:00:00 2001 From: foobar Date: Mon, 4 Dec 2000 17:07:27 +0000 Subject: [PATCH] @- 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 --- ext/ldap/ldap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.50.1