@@ -3710,18 +3710,20 @@ int _ldap_rebind_proc(LDAP *ldap, const char *url, ber_tag_t req, ber_int_t msgi
37103710/* {{{ Set a callback function to do re-binds on referral chasing. */
37113711PHP_FUNCTION (ldap_set_rebind_proc )
37123712{
3713- zval * link , * callback ;
3713+ zval * link ;
3714+ zend_fcall_info fci ;
3715+ zend_fcall_info_cache fcc ;
37143716 ldap_linkdata * ld ;
37153717
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 ) {
37173719 RETURN_THROWS ();
37183720 }
37193721
37203722 if ((ld = (ldap_linkdata * )zend_fetch_resource (Z_RES_P (link ), "ldap link" , le_link )) == NULL ) {
37213723 RETURN_THROWS ();
37223724 }
37233725
3724- if (Z_TYPE_P ( callback ) == IS_NULL ) {
3726+ if (! ZEND_FCI_INITIALIZED ( fci ) ) {
37253727 /* unregister rebind procedure */
37263728 if (!Z_ISUNDEF (ld -> rebindproc )) {
37273729 zval_ptr_dtor (& ld -> rebindproc );
@@ -3731,20 +3733,14 @@ PHP_FUNCTION(ldap_set_rebind_proc)
37313733 RETURN_TRUE ;
37323734 }
37333735
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-
37403736 /* register rebind procedure */
37413737 if (Z_ISUNDEF (ld -> rebindproc )) {
37423738 ldap_set_rebind_proc (ld -> link , _ldap_rebind_proc , (void * ) link );
37433739 } else {
37443740 zval_ptr_dtor (& ld -> rebindproc );
37453741 }
37463742
3747- ZVAL_COPY (& ld -> rebindproc , callback );
3743+ ZVAL_COPY (& ld -> rebindproc , & fci . function_name );
37483744 RETURN_TRUE ;
37493745}
37503746/* }}} */
0 commit comments