diff options
author | Jani Taskinen <jani@php.net> | 2009-11-18 17:44:58 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2009-11-18 17:44:58 +0000 |
commit | b741b026a19b007955631bc5e665ab4ef25b7a54 (patch) | |
tree | 822135049de73f04f4b06eb17a14e61d295d3eae /ext/ldap/ldap.c | |
parent | b7bb8aa54525bc04ad92b369981ebd5d027244a7 (diff) | |
download | php-git-b741b026a19b007955631bc5e665ab4ef25b7a54.tar.gz |
- Fixed bug #50185 (ldap_get_entries() return false instead of an empty array when there is no error).
# This is also revert of bad patch to bug #48469 and fixes it properly.
Diffstat (limited to 'ext/ldap/ldap.c')
-rw-r--r-- | ext/ldap/ldap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index e78236fde3..c1ca6c2f42 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -936,21 +936,21 @@ PHP_FUNCTION(ldap_get_entries) ldap = ld->link; num_entries = ldap_count_entries(ldap, ldap_result); + array_init(return_value); + add_assoc_long(return_value, "count", num_entries); + if (num_entries == 0) { - RETURN_NULL(); + return; } - num_entries = 0; ldap_result_entry = ldap_first_entry(ldap, ldap_result); if (ldap_result_entry == NULL) { + zval_dtor(return_value); RETURN_FALSE; } - array_init(return_value); - add_assoc_long(return_value, "count", num_entries); - + num_entries = 0; while (ldap_result_entry != NULL) { - MAKE_STD_ZVAL(tmp1); array_init(tmp1); |