summaryrefslogtreecommitdiff
path: root/ext/ldap/ldap.c
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2000-12-04 17:07:27 +0000
committerfoobar <sniper@php.net>2000-12-04 17:07:27 +0000
commitf48c0fbc9542e1e22aece92d35c7de15cc2f8d96 (patch)
treee2e0ff656ed995d8635efb490308dd66c2dc59cf /ext/ldap/ldap.c
parent81def6d9d52670b4211ec015e68519d94f95b4e9 (diff)
downloadphp-git-f48c0fbc9542e1e22aece92d35c7de15cc2f8d96.tar.gz
@- 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
Diffstat (limited to 'ext/ldap/ldap.c')
-rw-r--r--ext/ldap/ldap.c6
1 files 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;