Browse Source

- 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.
experimental/5.3-FPM
Jani Taskinen 16 years ago
parent
commit
b741b026a1
  1. 2
      NEWS
  2. 12
      ext/ldap/ldap.c

2
NEWS

@ -23,6 +23,8 @@ PHP NEWS
- Fixed bug #50212 (crash by ldap_get_option() with LDAP_OPT_NETWORK_TIMEOUT).
(Ilia, shigeru_kitazaki at cybozu dot co dot jp)
- Fixed bug #50185 (ldap_get_entries() return false instead of an empty array
when there is no error). (Jani)
- Fixed bug #50140 (With default compilation option, php symbols are
unresolved for nsapi). (Uwe Schindler)
- Fixed bug #50174 (Incorrectly matched docComment). (Felipe)

12
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);

Loading…
Cancel
Save