@@ -406,7 +406,7 @@ static void _php_ldap_control_to_array(LDAP *ld, LDAPControl* ctrl, zval* array,
406
406
}
407
407
}
408
408
409
- static int _php_ldap_control_from_array (LDAP * ld , LDAPControl * * ctrl , zval * array )
409
+ static int php_ldap_control_from_array (LDAP * ld , LDAPControl * * ctrl , const HashTable * control_ht )
410
410
{
411
411
zval * val ;
412
412
zend_string * control_oid ;
@@ -415,7 +415,7 @@ static int _php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, zval* arra
415
415
zend_string * tmpstring = NULL , * * tmpstrings1 = NULL , * * tmpstrings2 = NULL ;
416
416
size_t num_tmpstrings1 = 0 , num_tmpstrings2 = 0 ;
417
417
418
- if ((val = zend_hash_str_find (Z_ARRVAL_P ( array ) , "oid" , sizeof ("oid" ) - 1 )) == NULL ) {
418
+ if ((val = zend_hash_str_find (control_ht , "oid" , sizeof ("oid" ) - 1 )) == NULL ) {
419
419
zend_value_error ("%s(): Control must have an \"oid\" key" , get_active_function_name ());
420
420
return -1 ;
421
421
}
@@ -426,7 +426,7 @@ static int _php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, zval* arra
426
426
}
427
427
428
428
bool control_iscritical = false;
429
- if ((val = zend_hash_str_find (Z_ARRVAL_P ( array ) , "iscritical" , sizeof ("iscritical" ) - 1 )) != NULL ) {
429
+ if ((val = zend_hash_str_find (control_ht , "iscritical" , sizeof ("iscritical" ) - 1 )) != NULL ) {
430
430
control_iscritical = zend_is_true (val );
431
431
}
432
432
@@ -435,7 +435,7 @@ static int _php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, zval* arra
435
435
bool control_value_alloc = false;
436
436
int rc = LDAP_SUCCESS ;
437
437
438
- if ((val = zend_hash_find (Z_ARRVAL_P ( array ) , ZSTR_KNOWN (ZEND_STR_VALUE ))) != NULL ) {
438
+ if ((val = zend_hash_find (control_ht , ZSTR_KNOWN (ZEND_STR_VALUE ))) != NULL ) {
439
439
if (Z_TYPE_P (val ) != IS_ARRAY ) {
440
440
tmpstring = zval_get_string (val );
441
441
if (EG (exception )) {
@@ -786,7 +786,7 @@ static LDAPControl** php_ldap_controls_from_array(LDAP *ld, const HashTable *con
786
786
break ;
787
787
}
788
788
789
- if (_php_ldap_control_from_array (ld , ctrlp , ctrlarray ) == LDAP_SUCCESS ) {
789
+ if (php_ldap_control_from_array (ld , ctrlp , Z_ARRVAL_P ( ctrlarray ) ) == LDAP_SUCCESS ) {
790
790
++ ctrlp ;
791
791
} else {
792
792
error = 1 ;
0 commit comments