@@ -144,29 +144,29 @@ static const php_stream_ops php_stream_input_ops = {
144144 NULL /* set_option */
145145};
146146
147- static const int max_filter_count_default = 16 ;
147+ static const zend_long max_filter_count_default = 16 ;
148148
149- static int php_get_max_filter_count (php_stream_context * context ) {
149+ static zend_long php_get_max_filter_count (php_stream_context * context ) {
150150 if (context != NULL ) {
151151 zval * option_val = php_stream_context_get_option (context , "filter" , "max_filter_count" );
152152 if (option_val ) {
153153 zend_long custom_limit = zval_get_long (option_val );
154154 if (custom_limit >= 0 ) {
155- return ( int ) custom_limit ;
155+ return custom_limit ;
156156 }
157157 }
158158 }
159159 return -1 ;
160160}
161161
162162static bool php_stream_has_too_many_filters (php_stream * stream , php_stream_context * context ) {
163- int max_filter_count = php_get_max_filter_count (context );
163+ zend_long max_filter_count = php_get_max_filter_count (context );
164164 if (max_filter_count == -1 ) {
165165 // If not explicitly configured we don't throw an error yet.
166166 return false;
167167 }
168168
169- int count = MAX (php_stream_filter_count (& stream -> readfilters ), php_stream_filter_count (& stream -> writefilters ));
169+ zend_long count = MAX (php_stream_filter_count (& stream -> readfilters ), php_stream_filter_count (& stream -> writefilters ));
170170 return count > max_filter_count ;
171171}
172172
@@ -177,7 +177,7 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i
177177
178178 p = php_strtok_r (filterlist , "|" , & token );
179179 while (p ) {
180- int count = read_chain ? php_stream_filter_count (& stream -> readfilters ) : write_chain ? php_stream_filter_count (& stream -> writefilters ) : 0 ;
180+ zend_long count = read_chain ? php_stream_filter_count (& stream -> readfilters ) : write_chain ? php_stream_filter_count (& stream -> writefilters ) : 0 ;
181181 if (warn_filter_count && count == max_filter_count_default ) {
182182 zend_error (E_DEPRECATED , "Using more than %d filters in a php://filter URL is deprecated, "
183183 "set this limit using the stream context option max_filter_count, or use stream_filter_append" , max_filter_count_default );
0 commit comments