@@ -140,22 +140,34 @@ static void php_mcrypt_filter_dtor(php_stream_filter *thisfilter)
140140
141141static php_stream_filter_ops php_mcrypt_filter_ops = {
142142 php_mcrypt_filter ,
143+ #if PHP_VERSION_ID >= 80600
144+ NULL , /* seek */
145+ #endif
143146 php_mcrypt_filter_dtor ,
144147 "mcrypt.*"
145148};
146149
147150/* {{{ php_mcrypt_filter_create
148151 * Instantiate mcrypt filter
149152 */
153+ #if PHP_VERSION_ID >= 80600
154+ static php_stream_filter * php_mcrypt_filter_create (const char * filtername , zval * filterparams , bool persistent )
155+ #else
150156static php_stream_filter * php_mcrypt_filter_create (const char * filtername , zval * filterparams , uint8_t persistent )
157+ #endif
151158{
152159 int encrypt = 1 , iv_len , key_len , keyl , result ;
153160 const char * cipher = filtername + sizeof ("mcrypt." ) - 1 ;
154161 zval * tmpzval ;
155162 MCRYPT mcrypt_module ;
156163 char * iv = NULL , * key = NULL ;
164+ #if PHP_VERSION_ID >= 80600
165+ char * algo_dir = zend_ini_string_literal ("mcrypt.algorithms_dir" );
166+ char * mode_dir = zend_ini_string_literal ("mcrypt.modes_dir" );
167+ #else
157168 char * algo_dir = INI_STR ("mcrypt.algorithms_dir" );
158169 char * mode_dir = INI_STR ("mcrypt.modes_dir" );
170+ #endif
159171 char * mode = "cbc" ;
160172 php_mcrypt_filter_data * data ;
161173
@@ -265,7 +277,11 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
265277 data -> block_used = 0 ;
266278 data -> persistent = persistent ;
267279
280+ #if PHP_VERSION_ID >= 80600
281+ return php_stream_filter_alloc (& php_mcrypt_filter_ops , data , persistent , PSFS_SEEKABLE_NEVER );
282+ #else
268283 return php_stream_filter_alloc (& php_mcrypt_filter_ops , data , persistent );
284+ #endif
269285}
270286/* }}} */
271287
0 commit comments