@@ -3710,18 +3710,20 @@ int _ldap_rebind_proc(LDAP *ldap, const char *url, ber_tag_t req, ber_int_t msgi
3710
3710
/* {{{ Set a callback function to do re-binds on referral chasing. */
3711
3711
PHP_FUNCTION (ldap_set_rebind_proc )
3712
3712
{
3713
- zval * link , * callback ;
3713
+ zval * link ;
3714
+ zend_fcall_info fci ;
3715
+ zend_fcall_info_cache fcc ;
3714
3716
ldap_linkdata * ld ;
3715
3717
3716
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "rz " , & link , & callback ) != SUCCESS ) {
3718
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "rf! " , & link , & fci , & fcc ) == FAILURE ) {
3717
3719
RETURN_THROWS ();
3718
3720
}
3719
3721
3720
3722
if ((ld = (ldap_linkdata * )zend_fetch_resource (Z_RES_P (link ), "ldap link" , le_link )) == NULL ) {
3721
3723
RETURN_THROWS ();
3722
3724
}
3723
3725
3724
- if (Z_TYPE_P ( callback ) == IS_NULL ) {
3726
+ if (! ZEND_FCI_INITIALIZED ( fci ) ) {
3725
3727
/* unregister rebind procedure */
3726
3728
if (!Z_ISUNDEF (ld -> rebindproc )) {
3727
3729
zval_ptr_dtor (& ld -> rebindproc );
@@ -3731,20 +3733,14 @@ PHP_FUNCTION(ldap_set_rebind_proc)
3731
3733
RETURN_TRUE ;
3732
3734
}
3733
3735
3734
- /* callable? */
3735
- if (!zend_is_callable (callback , 0 , NULL )) {
3736
- zend_argument_type_error (2 , "must be a valid callback or null, %s given" , zend_zval_type_name (callback ));
3737
- RETURN_THROWS ();
3738
- }
3739
-
3740
3736
/* register rebind procedure */
3741
3737
if (Z_ISUNDEF (ld -> rebindproc )) {
3742
3738
ldap_set_rebind_proc (ld -> link , _ldap_rebind_proc , (void * ) link );
3743
3739
} else {
3744
3740
zval_ptr_dtor (& ld -> rebindproc );
3745
3741
}
3746
3742
3747
- ZVAL_COPY (& ld -> rebindproc , callback );
3743
+ ZVAL_COPY (& ld -> rebindproc , & fci . function_name );
3748
3744
RETURN_TRUE ;
3749
3745
}
3750
3746
/* }}} */
0 commit comments