@@ -132,7 +132,7 @@ function_entry imap_functions[] = {
132
132
#if defined(HAVE_IMAP2000 ) || defined (HAVE_IMAP2001 )
133
133
PHP_FE (imap_get_quota , NULL )
134
134
PHP_FE (imap_set_quota , NULL )
135
- PHP_FE (imap_setacl , NULL )
135
+ PHP_FE (imap_setacl , NULL )
136
136
#endif
137
137
138
138
#ifndef PHP_WIN32
@@ -1066,30 +1066,22 @@ PHP_FUNCTION(imap_set_quota)
1066
1066
PHP_FUNCTION (imap_setacl )
1067
1067
{
1068
1068
zval * * streamind , * * mailbox , * * id , * * rights ;
1069
- int ind , ind_type ;
1070
1069
pils * imap_le_struct ;
1071
-
1070
+
1072
1071
if (ZEND_NUM_ARGS () != 4 || zend_get_parameters_ex (4 , & streamind , & mailbox , & id , & rights ) == FAILURE ) {
1073
1072
ZEND_WRONG_PARAM_COUNT ();
1074
1073
}
1075
1074
1076
- convert_to_long_ex (streamind );
1075
+ ZEND_FETCH_RESOURCE (imap_le_struct , pils * , streamind , -1 , "imap" , le_imap );
1076
+
1077
1077
convert_to_string_ex (mailbox );
1078
- convert_to_string_ex (id );
1079
1078
convert_to_string_ex (rights );
1080
1079
1081
- ind = Z_LVAL_PP (streamind );
1082
- imap_le_struct = (pils * ) zend_list_find (ind , & ind_type );
1083
- if (!imap_le_struct || !IS_STREAM (ind_type )) {
1084
- php_error (E_WARNING , "Unable to find stream pointer" );
1085
- RETURN_FALSE ;
1086
- }
1087
-
1088
1080
RETURN_LONG (imap_setacl (imap_le_struct -> imap_stream , Z_STRVAL_PP (mailbox ), Z_STRVAL_PP (id ), Z_STRVAL_PP (rights )));
1089
1081
}
1090
1082
/* }}} */
1091
1083
1092
- #endif
1084
+ #endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */
1093
1085
1094
1086
1095
1087
/* {{{ proto int imap_expunge(int stream_id)
0 commit comments