mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
- Make sure people call ldap_first_attribute() before ldap_next_attribute()
This commit is contained in:
parent
4cd1594559
commit
2bd642c353
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user