Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
id: extension-matrix
uses: php/php-windows-builder/extension-matrix@v1
with:
php-version-list: '8.0, 8.1, 8.2, 8.3, 8.4, 8.5'
php-version-list: '8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6'
arch-list: 'x64'

windows:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5]
php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6]
use-opcache: [true, false]
experimental: [false]
steps:
Expand Down
16 changes: 16 additions & 0 deletions mcrypt_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,34 @@ static void php_mcrypt_filter_dtor(php_stream_filter *thisfilter)

static php_stream_filter_ops php_mcrypt_filter_ops = {
php_mcrypt_filter,
#if PHP_VERSION_ID >= 80600
NULL, /* seek */
#endif
php_mcrypt_filter_dtor,
"mcrypt.*"
};

/* {{{ php_mcrypt_filter_create
* Instantiate mcrypt filter
*/
#if PHP_VERSION_ID >= 80600
static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, bool persistent)
#else
static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, uint8_t persistent)
#endif
{
int encrypt = 1, iv_len, key_len, keyl, result;
const char *cipher = filtername + sizeof("mcrypt.") - 1;
zval *tmpzval;
MCRYPT mcrypt_module;
char *iv = NULL, *key = NULL;
#if PHP_VERSION_ID >= 80600
char *algo_dir = zend_ini_string_literal("mcrypt.algorithms_dir");
char *mode_dir = zend_ini_string_literal("mcrypt.modes_dir");
#else
char *algo_dir = INI_STR("mcrypt.algorithms_dir");
char *mode_dir = INI_STR("mcrypt.modes_dir");
#endif
char *mode = "cbc";
php_mcrypt_filter_data *data;

Expand Down Expand Up @@ -265,7 +277,11 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
data->block_used = 0;
data->persistent = persistent;

#if PHP_VERSION_ID >= 80600
return php_stream_filter_alloc(&php_mcrypt_filter_ops, data, persistent, PSFS_SEEKABLE_NEVER);
#else
return php_stream_filter_alloc(&php_mcrypt_filter_ops, data, persistent);
#endif
}
/* }}} */

Expand Down
Loading