cvs: php4 /ext/ldap ldap.c

From: Date: Mon, 04 Dec 2000 17:07:29 +0000
Subject: cvs: php4 /ext/ldap ldap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2936@lists.php.net to get a copy of this message
sniper Mon Dec 4 09:07:29 2000 EDT Modified files: /php4/ext/ldap ldap.c Log: @- 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 Index: php4/ext/ldap/ldap.c diff -u php4/ext/ldap/ldap.c:1.72 php4/ext/ldap/ldap.c:1.73 --- php4/ext/ldap/ldap.c:1.72 Sun Nov 12 18:02:40 2000 +++ php4/ext/ldap/ldap.c Mon Dec 4 09:07:27 2000 @@ -23,7 +23,7 @@ */ -/* $Id: ldap.c,v 1.72 2000/11/13 02:02:40 sniper Exp $ */ +/* $Id: ldap.c,v 1.73 2000/12/04 17:07:27 sniper Exp $ */ #define IS_EXT_MODULE #include "php.h" @@ -226,7 +226,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "LDAP Support", "enabled" ); - php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.72 2000/11/13 02:02:40 sniper Exp $" ); + php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.73 2000/12/04 17:07:27 sniper Exp $" ); php_info_print_table_row(2, "Total Links", maxl ); #ifdef LDAP_API_VERSION snprintf(ldapapiversion, 31, "%d", LDAP_API_VERSION); @@ -851,11 +851,13 @@ 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;

« previous php.cvs (#2936) next »