- Make sure people call ldap_first_attribute() before ldap_next_attribute()

This commit is contained in:
Jani Taskinen 2007-07-13 02:00:26 +00:00
parent 4cd1594559
commit 2bd642c353

View File

@ -1165,6 +1165,11 @@ PHP_FUNCTION(ldap_next_attribute)
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link);
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry);
if (resultentry->ber == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "called before calling ldap_first_attribute() or no attributes found in result entry");
RETURN_FALSE;
}
if ((attribute = ldap_next_attribute(ld->link, resultentry->data, resultentry->ber)) == NULL) {
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS
if (resultentry->ber != NULL) {